WordPress.org

Make WordPress Core

Ticket #10695: deprecated.php.diff

File deprecated.php.diff, 2.1 KB (added by scribu, 12 years ago)
  • wp-includes/user.php

     
    130130}
    131131
    132132/**
    133  * Retrieve user data based on field.
    134  *
    135  * Use get_profile() will make a database query to get the value of the table
    136  * column. The value might be cached using the query cache, but care should be
    137  * taken when using the function to not make a lot of queries for retrieving
    138  * user profile information.
    139  *
    140  * If the $user parameter is not used, then the user will be retrieved from a
    141  * cookie of the user. Therefore, if the cookie does not exist, then no value
    142  * might be returned. Sanity checking must be done to ensure that when using
    143  * get_profile() that empty/null/false values are handled and that something is
    144  * at least displayed.
    145  *
    146  * @since 1.5.0
    147  * @uses $wpdb WordPress database object to create queries.
    148  *
    149  * @param string $field User field to retrieve.
    150  * @param string $user Optional. User username.
    151  * @return string The value in the field.
    152  */
    153 function get_profile($field, $user = false) {
    154         global $wpdb;
    155         if ( !$user )
    156                 $user = $wpdb->escape($_COOKIE[USER_COOKIE]);
    157         return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) );
    158 }
    159 
    160 /**
    161133 * Number of posts user has written.
    162134 *
    163135 * @since 0.71
  • wp-includes/deprecated.php

     
    16901690        the_author_meta('ID');
    16911691}
    16921692
    1693 ?>
    1694  No newline at end of file
     1693/**
     1694 * Retrieve user data based on field.
     1695 *
     1696 * @since 1.5.0
     1697 * @deprecated 2.9
     1698 * @uses $wpdb WordPress database object to create queries.
     1699 */
     1700function get_profile($field, $user = false) {
     1701        _deprecated_function(__FUNCTION__, '2.9', 'get_the_author_meta()' );
     1702        global $wpdb;
     1703        if ( !$user )
     1704                $user = $wpdb->escape($_COOKIE[USER_COOKIE]);
     1705        return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) );
     1706}
     1707
     1708?>