-1

I have this plugin "DWQA" in which the ajax calls work perfectly fine when the user is not logged into the site. But the moment user logs in to the site the ajax calls dont work. The variables that are passed to the admin-ajax.php return null.

How does ajax call differ in wordpress in case of logged in and logged out users ?

Any way to make them same if yes ?

  • 1
    It would've made sense if it's the other way around. Please post your code. – sakibmoon Aug 17 '14 at 16:18
4

Probably it's because of this:

add_action( 'wp_ajax_my_action', 'my_action_callback' );
add_action( 'wp_ajax_nopriv_my_action', 'my_action_callback' );

You have to add the action for both hooks. Probably the plugin is hooked to the second hook right now.

You can read more in the docs.

0

It might be due to another plugin that affects your website only to logged in users. Try to disable them one by one and see if it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.