rest_cookie_collect_status

函式
rest_cookie_collect_status ( No parameters )

rest_cookie_collect_status。這個過濾鉤子允許開發者修改在檢查cookie的有效性時返回的狀態。

收集cookie認證狀態。

收集來自wp_validate_auth_cookie的錯誤,供rest_cookie_check_errors使用。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function rest_cookie_collect_status() {
global $wp_rest_auth_cookie;
$status_type = current_action();
if ( 'auth_cookie_valid' !== $status_type ) {
$wp_rest_auth_cookie = substr( $status_type, 12 );
return;
}
$wp_rest_auth_cookie = true;
}
function rest_cookie_collect_status() { global $wp_rest_auth_cookie; $status_type = current_action(); if ( 'auth_cookie_valid' !== $status_type ) { $wp_rest_auth_cookie = substr( $status_type, 12 ); return; } $wp_rest_auth_cookie = true; }
function rest_cookie_collect_status() {
	global $wp_rest_auth_cookie;

	$status_type = current_action();

	if ( 'auth_cookie_valid' !== $status_type ) {
		$wp_rest_auth_cookie = substr( $status_type, 12 );
		return;
	}

	$wp_rest_auth_cookie = true;
}

常見問題

FAQs
檢視更多 >