Plugin Directory

!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.


'ajax-extend' allows you call functions, a function in one plugin or a function you write or even a core wordpress function, via Ajax, in th

How to do with ajax-extend?

The javascript code:

$j.ajax( {
    url : home_url,
    type : 'POST',
    dataType : 'html',
    data : {
        'ajax_extend_mark' : 1, /* this is indispensable if you want ajax-extend to call the function you need. */
        'ajax_extend_action' : 'my_function', /* the function name (a WP core function, or a function in one plugin. any functions loaded by wp()) */
        'name' : 'sunjianle',
    success : function(data, textStatus, errorThron) {

The background PHP code:

function my_function()
    $name = $_POST["name"];
    echo "Hello, " . $name;

    global $wpdb;
    $query_sql = "select user_login
                from wp_users
                limit 0,10";
    $users = $wpdb->get_results($wpdb->prepare($query_sql));
    foreach($users as $user){
        echo $users->user_login;

How can I test if ajax-extend is working?

How does ajax-extend work?

add_action( "wp", "ajax_operation" );

function ajax_operation()
     * ajax_extend_mark : 
     * ajax_extend_action :
        $function_name = $_REQUEST["ajax_extend_action"];

That is the core code and the all code of ajax-extend. What you need to understand the code above.

Are there any limitations to which functions I can use?

Yes. 1. Functions must return valid HTML - this will be called in php and returned via the Ajax call 2. Functions cannot accept any parameters (at least at the moment)

Requires: 3.1 or higher
Compatible up to: 3.2.1
Last Updated: 4 years ago
Active Installs: Less than 10


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.