How-to debug wp_ajax_* hook callback?

I’m currently developing a plugin that uses ajax functionality.

Problem: The callback isn’t fired = no data gets processed.

if ( ! is_admin() )
    add_action( 'after_setup_theme', array( 'wpseAjaxClass', 'init' ), 10 );

Related posts

Leave a Reply

1 comment

  1. The answer was as stupid as simple: I wrapped the init for the class in a ! is_admin() call. This successfully prevented the callback from beeing fired.

    Rule for AJAX loading

    • Load it in public
    • Don’t hide it behind a ! is_admin() call.

    The 2nd line from admin-ajax.php

    define( 'WP_ADMIN', true );