Make WordPress Core

Ticket #26148: 26148.3.patch

File 26148.3.patch, 7.6 KB (added by SergeyBiryukov, 12 years ago)
  • src/wp-includes/user.php

     
    2020 *
    2121 * @param array $credentials Optional. User info in order to sign on.
    2222 * @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.
    2424 */
    2525function wp_signon( $credentials = array(), $secure_cookie = '' ) {
    2626        if ( empty($credentials) ) {
     
    3737        else
    3838                $credentials['remember'] = false;
    3939
    40         // TODO do we deprecate the wp_authentication action?
    4140        /**
    4241         * Fires before the user is authenticated.
    4342         *
     
    101100
    102101/**
    103102 * 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.
    104110 */
    105111function wp_authenticate_username_password($user, $username, $password) {
    106112        if ( is_a( $user, 'WP_User' ) ) {
     
    149155
    150156/**
    151157 * 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.
    152165 */
    153166function wp_authenticate_cookie($user, $username, $password) {
    154167        if ( is_a( $user, 'WP_User' ) ) {
     
    181194 * spammer, or if the user's primary blog has been marked as spam.
    182195 *
    183196 * @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.
    184200 */
    185201function wp_authenticate_spam_check( $user ) {
    186202        if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) {
     
    204220 * Number of posts user has written.
    205221 *
    206222 * @since 3.0.0
    207  * @uses $wpdb WordPress database object for queries.
     223 * @global $wpdb WordPress database object for queries.
    208224 *
    209225 * @param int $userid User ID.
    210226 * @return int Amount of posts user has written.
     
    291307 * The option will first check for the per site name and then the per Network name.
    292308 *
    293309 * @since 2.0.0
    294  * @uses $wpdb WordPress database object for queries.
     310 * @global $wpdb WordPress database object for queries.
    295311 * @uses apply_filters() Calls 'get_user_option_$option' hook with result,
    296312 *              option parameter, and user data object.
    297313 *
     
    298314 * @param string $option User option name.
    299315 * @param int $user Optional. User ID.
    300316 * @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.
    302318 */
    303319function get_user_option( $option, $user = 0, $deprecated = '' ) {
    304320        global $wpdb;
     
    344360 * Deletes the user option if $newvalue is empty.
    345361 *
    346362 * @since 2.0.0
    347  * @uses $wpdb WordPress database object for queries
     363 * @global $wpdb WordPress database object for queries.
    348364 *
    349  * @param int $user_id User ID
     365 * @param int $user_id User ID.
    350366 * @param string $option_name User option name.
    351367 * @param mixed $newvalue User option value.
    352368 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific).
    353  * @return unknown
     369 * @return int|bool User meta ID if the option didn't exist, true on successful update, false on failure.
    354370 */
    355371function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
    356372        global $wpdb;
     
    369385 * it will prepend the WordPress table prefix to the option name.
    370386 *
    371387 * @since 3.0.0
    372  * @uses $wpdb WordPress database object for queries
     388 * @global $wpdb WordPress database object for queries
    373389 *
    374390 * @param int $user_id User ID
    375391 * @param string $option_name User option name.
    376392 * @param bool $global Optional. Whether option name is global or blog specific. Default false (blog specific).
    377  * @return unknown
     393 * @return bool True on success, false on failure.
    378394 */
    379395function delete_user_option( $user_id, $option_name, $global = false ) {
    380396        global $wpdb;
     
    426442        var $query_limit;
    427443
    428444        /**
    429          * PHP5 constructor
     445         * PHP5 constructor.
    430446         *
    431447         * @since 3.1.0
    432448         *
    433          * @param string|array $args The query variables
     449         * @param string|array $args Optional. The query variables.
    434450         * @return WP_User_Query
    435451         */
    436452        function __construct( $query = null ) {
     
    441457        }
    442458
    443459        /**
    444          * Prepare the query variables
     460         * Prepare the query variables.
    445461         *
    446462         * @since 3.1.0
    447463         *
    448          * @param string|array $args The query variables
     464         * @param string|array $args Optional. The query variables.
    449465         */
    450466        function prepare_query( $query = array() ) {
    451467                global $wpdb;
     
    653669        }
    654670
    655671        /**
    656          * Execute the query, with the current variables
     672         * Execute the query, with the current variables.
    657673         *
    658674         * @since 3.1.0
     675         * @global $wpdb WordPress database object for queries.
    659676         */
    660677        function query() {
    661678                global $wpdb;
     
    758775        }
    759776
    760777        /**
    761          * Return the list of users
     778         * Return the list of users.
    762779         *
    763780         * @since 3.1.0
    764781         * @access public
     
    770787        }
    771788
    772789        /**
    773          * Return the total number of users for the current query
     790         * Return the total number of users for the current query.
    774791         *
    775792         * @since 3.1.0
    776793         * @access public
     
    786803 * Retrieve list of users matching criteria.
    787804 *
    788805 * @since 3.1.0
    789  * @uses $wpdb
    790806 * @uses WP_User_Query See for default arguments and information.
    791807 *
    792808 * @param array $args Optional.
     
    806822 * Get the blogs a user belongs to.
    807823 *
    808824 * @since 3.0.0
     825 * @global $wpdb WordPress database object for queries.
    809826 *
    810827 * @param int $user_id User ID
    811828 * @param bool $all Whether to retrieve all blogs, or only blogs that are not marked as deleted, archived, or spam.
     
    11541171 * </ol>
    11551172 *
    11561173 * @since 2.3.0
    1157  * @uses $wpdb WordPress database object for queries
     1174 * @global $wpdb WordPress database object for queries.
    11581175 *
    11591176 * @param string|array $args Optional. Override defaults.
    11601177 * @return string|null Null on display. String of HTML content on retrieve.
     
    13931410 * Checks whether the given email exists.
    13941411 *
    13951412 * @since 2.1.0
    1396  * @uses $wpdb
    13971413 *
    13981414 * @param string $email Email.
    13991415 * @return bool|int The user's ID on success, and false on failure.
     
    14601476 * 'yim' - User's Yahoo IM account.
    14611477 *
    14621478 * @since 2.0.0
    1463  * @uses $wpdb WordPress database layer.
     1479 * @global $wpdb WordPress database object for queries.
    14641480 * @uses apply_filters() Calls filters for most of the $userdata fields with the prefix 'pre_user'. See note above.
    14651481 * @uses do_action() Calls 'profile_update' hook when updating giving the user's ID
    14661482 * @uses do_action() Calls 'user_register' hook when creating a new user giving the user's ID
     
    18411857 * hashing process. This field is now hashed; old values are no longer accepted
    18421858 * but have a different WP_Error code so good user feedback can be provided.
    18431859 *
    1844  * @uses $wpdb WordPress Database object
     1860 * @global $wpdb WordPress database object for queries.
    18451861 *
    18461862 * @param string $key       Hash to validate sending user's password.
    18471863 * @param string $login     The user login.