Admin-ajax.php is dying “0” without processing function

This is one of those rare times I can proudly say… there isn’t any problem here!

The reason the server is returning with 0 is because I was logged in! The wp_ajax_nopriv_example_ajax_request is only for users who are not logged in. After logging out this works fine.

So if you are looking to do the same thing, just make sure you have both actions below the function:

add_action( 'wp_ajax_example_ajax_request', 'example_ajax_request' );
add_action( 'wp_ajax_nopriv_example_ajax_request', 'example_ajax_request' );