Make WordPress Core

Ticket #26148: 26148.diff

File 26148.diff, 4.8 KB (added by morganestes, 12 years ago)
  • wp-includes/user.php

     
    1111 * The credentials is an array that has 'user_login', 'user_password', and
    1212 * 'remember' indices. If the credentials is not given, then the log in form
    1313 * will be assumed and used if set.
    14  *
    1514 * The various authentication cookies will be set by this function and will be
    1615 * set for a longer period depending on if the 'remember' credential is set to
    1716 * true.
     
    1817 *
    1918 * @since 2.5.0
    2019 *
    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.
    2424 */
    2525function wp_signon( $credentials = '', $secure_cookie = '' ) {
    2626        if ( empty($credentials) ) {
     
    6767
    6868/**
    6969 * 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
    7078 */
    71 add_filter('authenticate', 'wp_authenticate_username_password', 20, 3);
    7279function wp_authenticate_username_password($user, $username, $password) {
    7380        if ( is_a($user, 'WP_User') ) { return $user; }
    7481
     
    102109
    103110        return $user;
    104111}
     112add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
    105113
    106114/**
    107115 * 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.
    108124 */
    109125function wp_authenticate_cookie($user, $username, $password) {
    110126        if ( is_a($user, 'WP_User') ) { return $user; }
     
    135151 * spammer, or if the user's primary blog has been marked as spam.
    136152 *
    137153 * @since 3.7.0
     154 *
     155 * @param $user
     156 *
     157 * @return \WP_User|\WP_Error WP_Error if spammer/spam, WP_User if clear.
    138158 */
    139159function wp_authenticate_spam_check( $user ) {
    140160        if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) {
     
    220240
    221241/**
    222242 * Retrieve user option that can be either per Site or per Network.
    223  *
    224243 * If the user ID is not given, then the current user will be used instead. If
    225244 * the user ID is given, then the user data will be retrieved. The filter for
    226245 * the result, will also pass the original option name and finally the user data
    227246 * object as the third parameter.
    228  *
    229247 * The option will first check for the per site name and then the per Network name.
    230248 *
    231249 * @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.
    235253 *
    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 *
    239258 * @return mixed
    240259 */
    241260function get_user_option( $option, $user = 0, $deprecated = '' ) {
     
    277296 * @param string $option_name User option name.
    278297 * @param mixed $newvalue User option value.
    279298 * @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.
    281301 */
    282302function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
    283303        global $wpdb;
     
    301321 * @param int $user_id User ID
    302322 * @param string $option_name User option name.
    303323 * @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.
    305326 */
    306327function delete_user_option( $user_id, $option_name, $global = false ) {
    307328        global $wpdb;
     
    355376        /**
    356377         * PHP5 constructor
    357378         *
    358          * @since 3.1.0
     379         * @since    3.1.0
    359380         *
    360          * @param string|array $args The query variables
     381         * @param $query
     382         *
     383         * @internal param array|string $args The query variables
    361384         * @return WP_User_Query
    362385         */
    363386        function __construct( $query = null ) {
     
    387410        }
    388411
    389412        /**
    390          * Prepare the query variables
     413         * Prepare the query variables.
    391414         *
    392415         * @since 3.1.0
    393416         * @access private