Setting attribute disabled on a SPAN element to prevent click events

I have a SPAN element which does something on a click event.

When I disable it, using jQuery:

$("span").attr("disabled", true);

The event handler continues to be called when I click on the span element.

T o prevent click event, you can try this:

$("span").css("pointer-events", "none");

you can enabled those back by

$("span").css("pointer-events", "auto");

How to Increase WordPress Menu Items Limit

If you are going to add too many menu items in your WordPress then beware, on saving your menu you will lost menu items that are beyond WordPress menu items limit. This thing had happened to us and we did a lot of extra work to add those menu items again but only after increasing this limit.

This limit is not imposed by WordPress but by your web hosting server because of some security reasons. In PHP, there is a thing called post vars that controls menu items. By default maximum post vars are much limited as most of the websites require only a few menu items.

First Method

Increasing max_input_vars

To increase input_vars add the following code in your php.ini file

max_input_vars = 3000;

Note – Create a text file name php.ini and add this code to that file and place this file in your WordPress root. If your host doesn’t support custom php.ini file get their support to add this code to php.ini file.

Second method

1.Add php.ini in wp-admin folder

Create a php.ini file with the below given code and put it into wp-admin folder

max_input_vars = 3000;

2.Add .user.ini file

Create a file .user.ini and add the following code to it and try placing it in WordPress root or in wp-admin folder;

max_input_vars = 5000;

Hopefully one of the method should work for you.

How to get Controller, Action, URL informations with CodeIgniter

I have these urls:

How to get controller name, action name from these urls. I’m codeigniter newbie. Are there any helper function to get this info.

You could use the URI Class:

$this->uri->segment(n); // n=1 for controller, n=2 for method, etc

There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, we could use

 $controllerName = $this->uri->segment(1, 'magazine');  

I’ve also been told that the following work, but am currently unable to test:


Convert plain text url’s to clickable links

Just copy this function and make your links clickable

function plain_url_to_link($string) {
    return preg_replace(
    '<a target="blank" rel="nofollow" href="$0" target="_blank">$0</a>', $string);
$str = " is a search website, you can also visit and";
echo plain_url_to_link($str);