Changeset 13464
- Timestamp:
- 02/27/2010 06:11:45 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r13425 r13464 2431 2431 remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+ 2432 2432 } 2433 2434 /** 2435 * Retrieve user data based on field. 2436 * 2437 * @since 1.5.0 2438 * @deprecated 3.0.0 2439 * @deprecated Use get_the_author_meta() 2440 * @see get_the_author_meta() 2441 */ 2442 function get_profile( $field, $user = false ) { 2443 _deprecated_function(__FUNCTION__, '3.0', 'get_the_author_meta()' ); 2444 if ( $user ) { 2445 $user = get_user_by( 'login', $user ); 2446 $user = $user->ID; 2447 } 2448 return get_the_author_meta( $field, $user ); 2449 } -
trunk/wp-includes/user.php
r13382 r13464 138 138 139 139 return $user; 140 }141 142 /**143 * Retrieve user data based on field.144 *145 * Use get_profile() will make a database query to get the value of the table146 * column. The value might be cached using the query cache, but care should be147 * taken when using the function to not make a lot of queries for retrieving148 * user profile information.149 *150 * If the $user parameter is not used, then the user will be retrieved from a151 * cookie of the user. Therefore, if the cookie does not exist, then no value152 * might be returned. Sanity checking must be done to ensure that when using153 * get_profile() that empty/null/false values are handled and that something is154 * at least displayed.155 *156 * @since 1.5.0157 * @uses $wpdb WordPress database object to create queries.158 *159 * @param string $field User field to retrieve.160 * @param string $user Optional. User username.161 * @return string The value in the field.162 */163 function get_profile($field, $user = false) {164 global $wpdb;165 if ( !$user )166 $user = esc_sql( $_COOKIE[USER_COOKIE] );167 return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) );168 140 } 169 141
Note: See TracChangeset
for help on using the changeset viewer.