Ticket #26148: 26148.3.patch
| File 26148.3.patch, 7.6 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/user.php
20 20 * 21 21 * @param array $credentials Optional. User info in order to sign on. 22 22 * @param bool $secure_cookie Optional. Whether to use secure cookie. 23 * @return object Either WP_Error on failure, or WP_User on success.23 * @return WP_User|WP_Error WP_User on success, WP_Error on failure. 24 24 */ 25 25 function wp_signon( $credentials = array(), $secure_cookie = '' ) { 26 26 if ( empty($credentials) ) { … … 37 37 else 38 38 $credentials['remember'] = false; 39 39 40 // TODO do we deprecate the wp_authentication action?41 40 /** 42 41 * Fires before the user is authenticated. 43 42 * … … 101 100 102 101 /** 103 102 * Authenticate the user using the username and password. 103 * 104 * @since 2.8.0 105 * 106 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null. 107 * @param string $username Username for authentication. 108 * @param string $password Password for authentication. 109 * @return WP_User|WP_Error WP_User on success, WP_Error on failure. 104 110 */ 105 111 function wp_authenticate_username_password($user, $username, $password) { 106 112 if ( is_a( $user, 'WP_User' ) ) { … … 149 155 150 156 /** 151 157 * Authenticate the user using the WordPress auth cookie. 158 * 159 * @since 2.8.0 160 * 161 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null. 162 * @param string $username Username. If passed, cancels the cookie authentication. 163 * @param string $password Password. If passed, cancels the cookie authentication. 164 * @return WP_User|WP_Error WP_User on success, WP_Error on failure. 152 165 */ 153 166 function wp_authenticate_cookie($user, $username, $password) { 154 167 if ( is_a( $user, 'WP_User' ) ) { … … 181 194 * spammer, or if the user's primary blog has been marked as spam. 182 195 * 183 196 * @since 3.7.0 197 * 198 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null. 199 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer. 184 200 */ 185 201 function wp_authenticate_spam_check( $user ) { 186 202 if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) { … … 204 220 * Number of posts user has written. 205 221 * 206 222 * @since 3.0.0 207 * @ uses$wpdb WordPress database object for queries.223 * @global $wpdb WordPress database object for queries. 208 224 * 209 225 * @param int $userid User ID. 210 226 * @return int Amount of posts user has written. … … 291 307 * The option will first check for the per site name and then the per Network name. 292 308 * 293 309 * @since 2.0.0 294 * @ uses$wpdb WordPress database object for queries.310 * @global $wpdb WordPress database object for queries. 295 311 * @uses apply_filters() Calls 'get_user_option_$option' hook with result, 296 312 * option parameter, and user data object. 297 313 * … … 298 314 * @param string $option User option name. 299 315 * @param int $user Optional. User ID. 300 316 * @param bool $deprecated Use get_option() to check for an option in the options table. 301 * @return mixed 317 * @return mixed User option value on success, false on failure. 302 318 */ 303 319 function get_user_option( $option, $user = 0, $deprecated = '' ) { 304 320 global $wpdb; … … 344 360 * Deletes the user option if $newvalue is empty. 345 361 * 346 362 * @since 2.0.0 347 * @ uses $wpdb WordPress database object for queries363 * @global $wpdb WordPress database object for queries. 348 364 * 349 * @param int $user_id User ID 365 * @param int $user_id User ID. 350 366 * @param string $option_name User option name. 351 367 * @param mixed $newvalue User option value. 352 368 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific). 353 * @return unknown369 * @return int|bool User meta ID if the option didn't exist, true on successful update, false on failure. 354 370 */ 355 371 function update_user_option( $user_id, $option_name, $newvalue, $global = false ) { 356 372 global $wpdb; … … 369 385 * it will prepend the WordPress table prefix to the option name. 370 386 * 371 387 * @since 3.0.0 372 * @ uses$wpdb WordPress database object for queries388 * @global $wpdb WordPress database object for queries 373 389 * 374 390 * @param int $user_id User ID 375 391 * @param string $option_name User option name. 376 392 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific). 377 * @return unknown393 * @return bool True on success, false on failure. 378 394 */ 379 395 function delete_user_option( $user_id, $option_name, $global = false ) { 380 396 global $wpdb; … … 426 442 var $query_limit; 427 443 428 444 /** 429 * PHP5 constructor 445 * PHP5 constructor. 430 446 * 431 447 * @since 3.1.0 432 448 * 433 * @param string|array $args The query variables449 * @param string|array $args Optional. The query variables. 434 450 * @return WP_User_Query 435 451 */ 436 452 function __construct( $query = null ) { … … 441 457 } 442 458 443 459 /** 444 * Prepare the query variables 460 * Prepare the query variables. 445 461 * 446 462 * @since 3.1.0 447 463 * 448 * @param string|array $args The query variables464 * @param string|array $args Optional. The query variables. 449 465 */ 450 466 function prepare_query( $query = array() ) { 451 467 global $wpdb; … … 653 669 } 654 670 655 671 /** 656 * Execute the query, with the current variables 672 * Execute the query, with the current variables. 657 673 * 658 674 * @since 3.1.0 675 * @global $wpdb WordPress database object for queries. 659 676 */ 660 677 function query() { 661 678 global $wpdb; … … 758 775 } 759 776 760 777 /** 761 * Return the list of users 778 * Return the list of users. 762 779 * 763 780 * @since 3.1.0 764 781 * @access public … … 770 787 } 771 788 772 789 /** 773 * Return the total number of users for the current query 790 * Return the total number of users for the current query. 774 791 * 775 792 * @since 3.1.0 776 793 * @access public … … 786 803 * Retrieve list of users matching criteria. 787 804 * 788 805 * @since 3.1.0 789 * @uses $wpdb790 806 * @uses WP_User_Query See for default arguments and information. 791 807 * 792 808 * @param array $args Optional. … … 806 822 * Get the blogs a user belongs to. 807 823 * 808 824 * @since 3.0.0 825 * @global $wpdb WordPress database object for queries. 809 826 * 810 827 * @param int $user_id User ID 811 828 * @param bool $all Whether to retrieve all blogs, or only blogs that are not marked as deleted, archived, or spam. … … 1154 1171 * </ol> 1155 1172 * 1156 1173 * @since 2.3.0 1157 * @ uses $wpdb WordPress database object for queries1174 * @global $wpdb WordPress database object for queries. 1158 1175 * 1159 1176 * @param string|array $args Optional. Override defaults. 1160 1177 * @return string|null Null on display. String of HTML content on retrieve. … … 1393 1410 * Checks whether the given email exists. 1394 1411 * 1395 1412 * @since 2.1.0 1396 * @uses $wpdb1397 1413 * 1398 1414 * @param string $email Email. 1399 1415 * @return bool|int The user's ID on success, and false on failure. … … 1460 1476 * 'yim' - User's Yahoo IM account. 1461 1477 * 1462 1478 * @since 2.0.0 1463 * @ uses $wpdb WordPress database layer.1479 * @global $wpdb WordPress database object for queries. 1464 1480 * @uses apply_filters() Calls filters for most of the $userdata fields with the prefix 'pre_user'. See note above. 1465 1481 * @uses do_action() Calls 'profile_update' hook when updating giving the user's ID 1466 1482 * @uses do_action() Calls 'user_register' hook when creating a new user giving the user's ID … … 1841 1857 * hashing process. This field is now hashed; old values are no longer accepted 1842 1858 * but have a different WP_Error code so good user feedback can be provided. 1843 1859 * 1844 * @ uses $wpdb WordPress Database object1860 * @global $wpdb WordPress database object for queries. 1845 1861 * 1846 1862 * @param string $key Hash to validate sending user's password. 1847 1863 * @param string $login The user login.