Ajaxize will allow you to ajaxize almost any php function on your site.

It can be a plugin, a function you wrote, or even a core wordpress function.


There are some (obvious or less obvious) limitations currently:


Enter a function name below.

Function Name:

The generated div can be inserted to any page/post on the site and will ajaxize the call to the function automatically.

Please make sure you enter a valid function name, that the function does not require any parameters, and that it returns valid HTML.

Copy & paste this div below

"; $output_div = "
"; $content .= "
" . htmlentities($output_div) . "
"; $content .= "

Function output (via ajaxize):

"; $content .= '
'; $content .= str_replace('><', '> If you see this message. Something is not working <', $output_div); $content .= '
'; return $content; } function ajaxize_admin_add_page() { global $ajaxize_this_hook; $ajaxize_this_hook = add_options_page('Ajaxize settings', 'Ajaxize', 'manage_options', 'ajaxize_this', 'ajaxize_options_page'); } // display the admin options page function ajaxize_options_page() { ?>

Ajaxize

A random Secret Key was automatically generated when the plugin was first installed.
You can change your secret key, but please be aware that any previously-generated divs will stop working.
Do not post or share this key.

De-selecting Ajax Referer Check can help with some browsers with aggressive caching.
You can de-select Ajax Referer Check if your ajaxize functions have no side-effect. Recommended settings: On

"; } function plugin_setting_ajax_referer_check () { $options = get_option('ajaxize_this_options'); if ($options['ajax_referer_check'] == 1) { $checked = "checked='checked'"; } echo ""; } // validate our options function ajaxize_options_validate_secret_key($input) { $options = get_option('ajaxize_this_options'); $options['ajax_referer_check'] = 0; // doing per-field regex validation. // You can add / change validation rules here foreach ($input as $k => $v) { if (preg_match('/ajax_referer_check/i', $k)) { $options[$k] = $v; continue; } if (preg_match('/^[a-z0-9]{12,}$/i', $v)) { $options[$k] = $v; } else { add_settings_error('secret_key','ajaxize_this_err','Secret Key must be alphanumeric and at least 12 characters long','error'); } } return $options; } function ajaxize_this_validate_function($fn_name) { if (preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $fn_name)) { if (! function_exists($fn_name)) { add_action('admin_notices', create_function('', 'echo \'

Fuction not found.

\';')); } else return $fn_name; } else { add_action('admin_notices', create_function('', 'echo \'

Invalid function name. Make sure to remove () and any extra spaces.

\';')); } } add_filter('contextual_help', 'ajaxize_this_help', 10, 3); // help page for ajaxize plugin (taken from FAQ) function ajaxize_this_help($contextual_help, $screen_id, $screen) { global $ajaxize_this_hook; if ($screen_id == $ajaxize_this_hook) { $contextual_help = <<Ajaxize

Ajaxize will allow you to ajaxize almost any php function on your site. It can be a plugin, a function you wrote, or even a core wordpress function.


Frequently Asked Questions

Please check out the Frequently Asked Questions page for more info. EOD; } return $contextual_help; } /* END PLUGIN SETTINGS */ ?>