WordPress plugin: xajax for WordPress

xajax is still my preferred AJAX tool because you can code the functions in PHP. This is great for those who doesn’t have time to learn jQuery or any other languages and are able to add ajax functionality to a site instantly. (And you probably don’t want to learn them after grasping xajax.)

When i wanted to use it in a WordPress project a while ago, the only plugin i could find was wp-ajax. It was released back in 2008 and uses and older version of xajax. The latest version is 0.6 beta. There have been quite a lot of changes to the library.

As part of learning about plugin development for WordPress, I decided to package a plugin based on the existing plugin.

It’s more or less the same, But updated xajax to v0.6 beta. I also changed the function names, just my preference for function names.

The plugin was originally developed in WordPress v3.1 and I have updated the codes and tested on latest version (v3.3.2). It can be downloaded here. It’s free! I will add this to wordpress’s plugin directory if people find it useful.

License

I’m not sure which one to choose.

Basically it’s free. you can do whatever you want with it. It’s greatly appreciated if you can link back and contribute a small donation.

If you have any advises please let me know in comments.

Releases

0.1 – initial beta release.

Installation

  • download the plugin. Untar.
  • Upload the folder to wp-content/plugins directory.
  • Activate the plugin via plugins menu.

Example

define and register function:

function my_function() {
    // xajax function in php code
}
function register_xajax_functions() {
    xajax_function('my_function');
    xajax_function('any_other_functions');
}
add_actions('init', 'register_xajax_functions');

note line 5: the function name must match the name of function defined.

To make any other xajax function calls, use the global variable $xajax.

Please refer to xajax’s docs and tutorial on how to use this library.

Support

Let me know if you use this plugin in your projects and if you have any suggestions and feedback to the plugin.

Please report any plugins issues to xajax for WordPress project page. (Please do no use the comments as i want to easily keep track of any problems.)

If you have any issues with xajax, please use the xajax’s support forum.

Leave a Reply

Your email address will not be published. Required fields are marked *