Ticket #26148: 26148.diff
| File 26148.diff, 4.8 KB (added by , 12 years ago) |
|---|
-
wp-includes/user.php
11 11 * The credentials is an array that has 'user_login', 'user_password', and 12 12 * 'remember' indices. If the credentials is not given, then the log in form 13 13 * will be assumed and used if set. 14 *15 14 * The various authentication cookies will be set by this function and will be 16 15 * set for a longer period depending on if the 'remember' credential is set to 17 16 * true. … … 18 17 * 19 18 * @since 2.5.0 20 19 * 21 * @param array $credentials Optional. User info in order to sign on. 22 * @param bool $secure_cookie Optional. Whether to use secure cookie. 23 * @return object Either WP_Error on failure, or WP_User on success. 20 * @param array|string $credentials Optional. User info in order to sign on. 21 * @param bool|string $secure_cookie Optional. Whether to use secure cookie. 22 * 23 * @return \WP_Error|\WP_User WP_Error on failure, or WP_User on success. 24 24 */ 25 25 function wp_signon( $credentials = '', $secure_cookie = '' ) { 26 26 if ( empty($credentials) ) { … … 67 67 68 68 /** 69 69 * Authenticate the user using the username and password. 70 * 71 * @since 2.8.0 72 * 73 * @param $user 74 * @param string $username 75 * @param string $password 76 * 77 * @return mixed|void|\WP_Error 70 78 */ 71 add_filter('authenticate', 'wp_authenticate_username_password', 20, 3);72 79 function wp_authenticate_username_password($user, $username, $password) { 73 80 if ( is_a($user, 'WP_User') ) { return $user; } 74 81 … … 102 109 103 110 return $user; 104 111 } 112 add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); 105 113 106 114 /** 107 115 * Authenticate the user using the WordPress auth cookie. 116 * 117 * @since 2.8.0 118 * 119 * @param $user 120 * @param string $username 121 * @param string $password 122 * 123 * @return \WP_Error|\WP_User WP_Error on failure, WP_User on success. 108 124 */ 109 125 function wp_authenticate_cookie($user, $username, $password) { 110 126 if ( is_a($user, 'WP_User') ) { return $user; } … … 135 151 * spammer, or if the user's primary blog has been marked as spam. 136 152 * 137 153 * @since 3.7.0 154 * 155 * @param $user 156 * 157 * @return \WP_User|\WP_Error WP_Error if spammer/spam, WP_User if clear. 138 158 */ 139 159 function wp_authenticate_spam_check( $user ) { 140 160 if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) { … … 220 240 221 241 /** 222 242 * Retrieve user option that can be either per Site or per Network. 223 *224 243 * If the user ID is not given, then the current user will be used instead. If 225 244 * the user ID is given, then the user data will be retrieved. The filter for 226 245 * the result, will also pass the original option name and finally the user data 227 246 * object as the third parameter. 228 *229 247 * The option will first check for the per site name and then the per Network name. 230 248 * 231 249 * @since 2.0.0 232 * @uses $wpdb WordPress database object for queries.233 * @uses apply_filters() Calls 'get_user_option_$option' hook with result,234 * option parameter, and user data object.250 * @uses $wpdb WordPress database object for queries. 251 * @uses apply_filters() Calls 'get_user_option_$option' hook with result, 252 * option parameter, and user data object. 235 253 * 236 * @param string $option User option name. 237 * @param int $user Optional. User ID. 238 * @param bool $deprecated Use get_option() to check for an option in the options table. 254 * @param string $option User option name. 255 * @param int $user Optional. User ID. 256 * @param bool|string $deprecated Use get_option() to check for an option in the options table. 257 * 239 258 * @return mixed 240 259 */ 241 260 function get_user_option( $option, $user = 0, $deprecated = '' ) { … … 277 296 * @param string $option_name User option name. 278 297 * @param mixed $newvalue User option value. 279 298 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific). 280 * @return unknown 299 * 300 * @return bool True on success, false on failure. 281 301 */ 282 302 function update_user_option( $user_id, $option_name, $newvalue, $global = false ) { 283 303 global $wpdb; … … 301 321 * @param int $user_id User ID 302 322 * @param string $option_name User option name. 303 323 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific). 304 * @return unknown 324 * 325 * @return bool True on success, false on failure. 305 326 */ 306 327 function delete_user_option( $user_id, $option_name, $global = false ) { 307 328 global $wpdb; … … 355 376 /** 356 377 * PHP5 constructor 357 378 * 358 * @since 3.1.0379 * @since 3.1.0 359 380 * 360 * @param string|array $args The query variables 381 * @param $query 382 * 383 * @internal param array|string $args The query variables 361 384 * @return WP_User_Query 362 385 */ 363 386 function __construct( $query = null ) { … … 387 410 } 388 411 389 412 /** 390 * Prepare the query variables 413 * Prepare the query variables. 391 414 * 392 415 * @since 3.1.0 393 416 * @access private