此处的“已验证”是指根据is_user_logged_in()
功能,即用户是否登录,无论用户角色如何。
此部分来自admin-ajax.php
文件,解释了所有内容:
if ( is_user_logged_in() ) {
/**
* Fires authenticated AJAX actions for logged-in users.
*
* The dynamic portion of the hook name, `$_REQUEST[\'action\']`,
* refers to the name of the AJAX action callback being fired.
*
* @since 2.1.0
*/
do_action( \'wp_ajax_\' . $_REQUEST[\'action\'] );
} else {
/**
* Fires non-authenticated AJAX actions for logged-out users.
*
* The dynamic portion of the hook name, `$_REQUEST[\'action\']`,
* refers to the name of the AJAX action callback being fired.
*
* @since 2.8.0
*/
do_action( \'wp_ajax_nopriv_\' . $_REQUEST[\'action\'] );
}