Support » Plugins » Ajax for subscribers not working

  • I have a very simple AJAX function that works fine when logged in as admin, but when logged in as a subscriber the call to admin-ajax.php returns a html page with the header and footer of my theme, and that’s it.

    By doing some wolf fencing I’ve tracked it down to line 37 of admin-ajax.php do_action( 'admin_init' );. It gets there and just returns rubbish.

Viewing 1 replies (of 1 total)
  • I have exactly the same problem.

    Working on wordpress 3.5.1 and my ajax request works well when logged in as an admin user (or contributor) and when not logged in.
    When logged in with a subscriber account, my ajax request returns the homepage content, which is obviously not what I want…

    Here is my code to create the ajax actions:

    add_action('wp_ajax_nopriv_subscribe_magazine', array(&$this, 'actionSubscribeMagazine') );
    add_action('wp_ajax_subscribe_magazine', array(&$this, 'actionSubscribeMagazine') );

    and my action function:

    public function actionSubscribeMagazine() {
     if ( empty( $_GET['idmag'] ) || ! is_user_logged_in() ) {
    			die( __( 'Sorry, we could not understand your request.' ) );
     // ...

    This action is never called when logged in as a subscriber.

Viewing 1 replies (of 1 total)
  • The topic ‘Ajax for subscribers not working’ is closed to new replies.