
如何在WordPress中编辑CSS(编辑、添加和自定义网站的外观)
wp_authenticate_cookie ( $user, $username, $password )
wp_authenticate_cookie: 这个函数用来验证一个用户,给出他们的认证cookies。
使用WordPress的auth cookie来认证用户。
function wp_authenticate_cookie( $user, $username, $password ) { if ( $user instanceof WP_User ) { return $user; } if ( empty( $username ) && empty( $password ) ) { $user_id = wp_validate_auth_cookie(); if ( $user_id ) { return new WP_User( $user_id ); } global $auth_secure_cookie; if ( $auth_secure_cookie ) { $auth_cookie = SECURE_AUTH_COOKIE; } else { $auth_cookie = AUTH_COOKIE; } if ( ! empty( $_COOKIE[ $auth_cookie ] ) ) { return new WP_Error( 'expired_session', __( 'Please log in again.' ) ); } // If the cookie is not set, be silent. } return $user; }