Reputation: 1189
I'm using Dave's Wordpress Live Search.
The problem I have, is live search - it works only for logged users. If i'm logged in, plugin works fine. I found this line:
'ajaxURL' => admin_url('admin-ajax.php', is_ssl()),
which mean plugin is using admin-ajax.php
and i think unlogged users haven't access to it.
I tried to define ajaxURL without , is_ssl()
:
'ajaxURL' => admin_url('admin-ajax.php'),
but didn't help.
Is it a problem with access to wp-admin/admin-ajax.php
? How can i change it?
Upvotes: 1
Views: 4206
Reputation: 2162
This is old, but I was looking into this. Rather than changing the core, you can duplicate the hooks of the plugin and add ''no_priv'' versions. I am sure this is more elegant than duplicating a file in the core.
See: http://codex.wordpress.org/AJAX_in_Plugins
From that page:
"Ajax on the Viewer-Facing Side As of WordPress 2.8, there is a new hook similar to 'wp_ajax_my_action':
'wp_ajax_nopriv_my_action' executes for users that are not logged in. So, if you want it to fire for both visitors and logged-in users, you can do this:
add_action('wp_ajax_my_action', 'my_action_callback');
add_action('wp_ajax_nopriv_my_action', 'my_action_callback');"
Upvotes: 6
Reputation:
In your case I would clone admin-ajax.php and rename it and remove all admin related conditionals from the file.
More specific:
Good luck! :)
Upvotes: 2