The wp_ajax_{action}
hook only fires for logged in users. For logged-out users the action wp_ajax_nopriv_{action}
is triggered on an ajax request – so you need to hook into that as well.
The wp_ajax_{action}
hook only fires for logged in users. For logged-out users the action wp_ajax_nopriv_{action}
is triggered on an ajax request – so you need to hook into that as well.