[wp-hackers] Talking to Ajax

Dino Termini dino at duechiacchiere.it
Sat Mar 31 02:44:50 UTC 2012


Hello list,

I am developing a plugin that displays a bunch of meta boxes. I'm trying 
to do something when the 'Show on screen' checkbox for the corresponding 
meta box is (un)selected. So I added

add_action('wp_ajax_closed-postboxes',  'closed_postboxes');

and

function closed_postboxes(){
         echo 'yeah';
}

to test it. But according to Firebug, admin-ajax.php returns -1, and the 
hook is not executed. What am I missing? I found this page

http://codex.wordpress.org/AJAX_in_Plugins

Can you please point me in the right direction?

Cheers,
Dino.


More information about the wp-hackers mailing list