WordPress admin-ajax.php 302 Redirection error via form -
here's "long story short" version of issue:
have newsletter/subscription form triggers wp-admin/admin-ajax.php file, form wasn't working when wasn't logged wordpress.
turns out, admin-ajax.php file has 302 going against it.
i have seen/tested previous resolutions of problem (namely this one , that one), none of them helpful.
i searched throughout theme files related "wp-admin" protections, didn't find anything.
modified , deactivated both wp better security , w3c (as various other plugins), nothing changed.
changed/removed htaccess, nothing changed.
i'm kind of getting frustrated issue.
@ point, know there's somewhere in code blocking access admin-ajax.php "outsiders," can't figure out where.
it's either protecting admin folder and/or protect admin-ajax.php.
any ideas?
help appreciated.
thanks in advance!
ok, problem here wordpress uses 2 different hooks ajax. uses 1 admin side, , 1 logged out user. guess form not using latter.
have @ two:
add_action('wp_ajax_my_action', 'my_action_callback'); add_action('wp_ajax_nopriv_my_action', 'my_action_callback');
from wordpress codex:
since wordpress 2.8, there hook similar wp_ajax_(action):
wp_ajax_nopriv_(action) executes users not logged in. so, if want fire on front-end both visitors , logged-in users, can this:
add_action('wp_ajax_my_action', 'my_action_callback'); add_action('wp_ajax_nopriv_my_action', 'my_action_callback');
Comments
Post a Comment