clear_auth_cookie
是我捕获实际注销操作所需的,但我无法让它返回任何内容。
https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/pluggable.php#L940
根据法典,它没有给出任何信息。理想情况下,我想做:
add_action( \'clear_auth_cookie\', \'return_user_data_on_logout\');
function return_user_data_on_logout( $user ) {
$id = $user->ID; //Assuming it returns a WP_User object.
//Do some logic here, mostly to check if the user if is of certain type /
has certain meta attached to them.
}
有什么想法吗?