Forums

$wp_filters loses ajax nopriv hook (2 posts)

  1. norbnorb
    Member
    Posted 5 months ago #

    Hi,

    I'm setting up an ajax nopriv request from a plugin.
    After add_action('wp_ajax_nopriv_abc'.. ) I verify with has_action() that my hook is registered (returns prio correctly).

    The ajax request, though, is rejected with -1 in plugins.php.
    The reason: $wp_filters doesn't contain my hook wp_ajax_nopriv_abc anymore.

    I don't have any clue how to proceed.

    regards

    norbnorb

  2. norbnorb
    Member
    Posted 5 months ago #

    ok,
    it works if you don't try to exclude admin pages:

    //if (is_admin() === false ) {
    add_action('wp_ajax_nopriv_abc', array ('this_class','abc'),7);
    //}

Reply

You must log in to post.

About this Topic