Ticket #23190: 23190.2.patch
| File 23190.2.patch, 2.1 KB (added by , 13 years ago) |
|---|
-
wp-includes/ms-deprecated.php
270 270 } 271 271 return $url; 272 272 } 273 274 /** 275 * Get a numeric user ID from either an email address or a login. 276 * 277 * A numeric string is considered to be an existing user ID 278 * and is simply returned as such. 279 * 280 * @since MU 281 * @deprecated 3.6.0 282 * @deprecated Use get_user_by() 283 * @uses is_email() 284 * 285 * @param string $string Either an email address or a login. 286 * @return int 287 */ 288 function get_user_id_from_string( $string ) { 289 $user_id = 0; 290 if ( is_email( $string ) ) { 291 $user = get_user_by('email', $string); 292 if ( $user ) 293 $user_id = $user->ID; 294 } elseif ( is_numeric( $string ) ) { 295 $user_id = $string; 296 } else { 297 $user = get_user_by('login', $string); 298 if ( $user ) 299 $user_id = $user->ID; 300 } 301 302 return $user_id; 303 } -
wp-includes/ms-functions.php
1317 1317 } 1318 1318 1319 1319 /** 1320 * Get a numeric user ID from either an email address or a login.1321 *1322 * @since MU1323 * @uses is_email()1324 *1325 * @param string $string1326 * @return int1327 */1328 function get_user_id_from_string( $string ) {1329 $user_id = 0;1330 if ( is_email( $string ) ) {1331 $user = get_user_by('email', $string);1332 if ( $user )1333 $user_id = $user->ID;1334 } elseif ( is_numeric( $string ) ) {1335 $user_id = $string;1336 } else {1337 $user = get_user_by('login', $string);1338 if ( $user )1339 $user_id = $user->ID;1340 }1341 1342 return $user_id;1343 }1344 1345 /**1346 1320 * Get a user's most recent post. 1347 1321 * 1348 1322 * Walks through each of a user's blogs to find the post with … … 1739 1713 * @return bool 1740 1714 */ 1741 1715 function is_user_spammy( $username = 0 ) { 1742 if ( $username == 0 ) {1716 if ( $username == 0 ) 1743 1717 $user = wp_get_current_user(); 1744 } else {1718 else 1745 1719 $user = get_user_by( 'login', $username ); 1746 }1747 1720 1748 1721 return ( isset( $user->spam ) && $user->spam == 1 ); 1749 1722 }