Plugin info

Total downloads: 1,493
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 8/20/2011 (5247 days ago)
Added to WordPress: 8/18/2011 (14 years old)
Minimum WordPress version: 3.1
Tested up to WordPress version: 3.2.1
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 5247 days ago

20/100

Is ajax-extend abandoned?

Possibly abandoned (last update 5247 days ago).

Compatibility

Requires WordPress: 3.1
Tested up to: 3.2.1
Requires PHP: f

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

No similar plugins found yet.

Description

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 the easiest way.

Example: 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) {         alert(data);     } }); 

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;     } } 

Installation

Automatic install: Using the WordPress dashboard * Login to your weblog * Go to Plugins * Select Add New * Search for ajax-extend * Select Install * Select Install Now * Select Activate Plugin

Manual: * Upload “ajax-extend” folder to the “/wp-content/plugins/” directory. * Activate the plugin through the “Plugins” menu in WordPress.

Frequently Asked Questions

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) {         alert(data);     } }); 

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 :      */     if(isset($_REQUEST["ajax_extend_mark"]))     {         $function_name = $_REQUEST["ajax_extend_action"];         if(!function_exists($function_name))             return;         call_user_func($function_name);         die();     }    
} 

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)

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.0

First release