Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
Looking at the WordPress source code, I’d say that wp_ajax_nopriv_* fires only if you’re not logged in, and wp_ajax_* fires otherwise. Here’s the relevant bit, in admin-ajax.php, lines 85-115 in version 5.0.3: if ( is_user_logged_in() ) { // If no action is registered, return a Bad Request response. if ( ! has_action( ‘wp_ajax_’ . $_REQUEST[‘action’] … Read more