January 2015 - thehazels January 2015 - thehazelsthehazels

Monthly Archives for January 2015

Ajax queries are redirected (admin-ajax.php 302)

I’ve just spent a lot of time working out why an ajax function was not working for non-logged in users. I’d added an action add_action(‘wp_ajax_nopriv_my_function’, ‘my_function’) and I’d made sure admin-ajax.php was localized wp_localize_script(‘ajax-post’, ‘wp-ajax’, array(‘ajaxurl’ => admin_url(‘admin-ajax.php’)). Unfortunately the call was … Continue reading

19. January 2015 by Antonia Whitaker
Categories: Wordpress | Tags: | Leave a comment