Changeset 32637
- Timestamp:
- 05/28/2015 03:50:34 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r32630 r32637 19 19 * 20 20 * @since 2.5.0 21 * 22 * @global string $auth_secure_cookie 21 23 * 22 24 * @param array $credentials Optional. User info in order to sign on. … … 161 163 * 162 164 * @since 2.8.0 165 * 166 * @global string $auth_secure_cookie 163 167 * 164 168 * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null. … … 232 236 * @param int|bool $user_id The user ID (or false) as received from the 233 237 * determine_current_user filter. 234 * @return int| boolUser ID if validated, false otherwise. If a user ID from235 * an earlier filter callback is received, that value is returned.238 * @return int|false User ID if validated, false otherwise. If a user ID from 239 * an earlier filter callback is received, that value is returned. 236 240 */ 237 241 function wp_validate_logged_in_cookie( $user_id ) { … … 287 291 * 288 292 * @since 3.0.0 293 * 294 * @global wpdb $wpdb 289 295 * 290 296 * @param array $users Array of user IDs. … … 517 523 * for `$orderby` parameter. 518 524 * @access public 525 * 526 * @global wpdb $wpdb 527 * @global int $blog_id 519 528 * 520 529 * @param string|array $query { … … 902 911 * @since 3.1.0 903 912 * 913 * @global wpdb $wpdb 914 * 904 915 * @param string $string 905 * @param array $cols906 * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for907 * single site.Single site allows leading and trailing wildcards, Network Admin only trailing.916 * @param array $cols 917 * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for single site. 918 * Single site allows leading and trailing wildcards, Network Admin only trailing. 908 919 * @return string 909 920 */ … … 960 971 * 961 972 * @param string $orderby Alias for the field to order by. 962 * @return string |bool Value to used in the ORDER clause, if `$orderby` is valid. False otherwise.973 * @return string Value to used in the ORDER clause, if `$orderby` is valid. 963 974 */ 964 975 protected function parse_orderby( $orderby ) { … … 1092 1103 * @param callable $name Method to call. 1093 1104 * @param array $arguments Arguments to pass when calling. 1094 * @return mixed |boolReturn value of the callback, false otherwise.1105 * @return mixed Return value of the callback, false otherwise. 1095 1106 */ 1096 1107 public function __call( $name, $arguments ) { … … 1258 1269 * @link https://codex.wordpress.org/Function_Reference/add_user_meta 1259 1270 * 1260 * @param int $user_idUser ID.1261 * @param string $meta_key Metadata name.1262 * @param mixed $meta_value Metadata value.1263 * @param bool $uniqueOptional, default is false. Whether the same key should not be added.1264 * @return int| boolMeta ID on success, false on failure.1271 * @param int $user_id User ID. 1272 * @param string $meta_key Metadata name. 1273 * @param mixed $meta_value Metadata value. 1274 * @param bool $unique Optional, default is false. Whether the same key should not be added. 1275 * @return int|false Meta ID on success, false on failure. 1265 1276 */ 1266 1277 function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) { … … 1278 1289 * @link https://codex.wordpress.org/Function_Reference/delete_user_meta 1279 1290 * 1280 * @param int $user_id user ID1281 * @param string $meta_key Metadata name.1282 * @param mixed $meta_value Optional. Metadata value.1291 * @param int $user_id User ID 1292 * @param string $meta_key Metadata name. 1293 * @param mixed $meta_value Optional. Metadata value. 1283 1294 * @return bool True on success, false on failure. 1284 1295 */ … … 1293 1304 * @link https://codex.wordpress.org/Function_Reference/get_user_meta 1294 1305 * 1295 * @param int $user_id User ID. 1296 * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys. 1297 * @param bool $single Whether to return a single value. 1298 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single 1299 * is true. 1306 * @param int $user_id User ID. 1307 * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys. 1308 * @param bool $single Whether to return a single value. 1309 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true. 1300 1310 */ 1301 1311 function get_user_meta($user_id, $key = '', $single = false) { … … 1314 1324 * @link https://codex.wordpress.org/Function_Reference/update_user_meta 1315 1325 * 1316 * @param int $user_idUser ID.1317 * @param string $meta_key Metadata key.1318 * @param mixed $meta_value Metadata value.1319 * @param mixed $prev_value Optional. Previous value to check before removing.1326 * @param int $user_id User ID. 1327 * @param string $meta_key Metadata key. 1328 * @param mixed $meta_value Metadata value. 1329 * @param mixed $prev_value Optional. Previous value to check before removing. 1320 1330 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. 1321 1331 */ … … 1333 1343 * 1334 1344 * @since 3.0.0 1345 * 1346 * @global wpdb $wpdb 1347 * 1335 1348 * @param string $strategy 'time' or 'memory' 1336 1349 * @return array Includes a grand total and an array of counts indexed by role strings. … … 1407 1420 * 1408 1421 * @since 2.0.4 1409 * @global string $userdata User description. 1410 * @global string $user_login The user username for logging in 1411 * @global int $user_level The level of the user 1412 * @global int $user_ID The ID of the user 1413 * @global string $user_email The email address of the user 1414 * @global string $user_url The url in the user's profile 1422 * 1423 * @global string $user_login The user username for logging in 1424 * @global object $userdata User data. 1425 * @global int $user_level The level of the user 1426 * @global int $user_ID The ID of the user 1427 * @global string $user_email The email address of the user 1428 * @global string $user_url The url in the user's profile 1415 1429 * @global string $user_identity The display name of the user 1416 1430 * … … 1454 1468 * 1455 1469 * @global wpdb $wpdb WordPress database object for queries. 1470 * @global int $blog_id 1456 1471 * 1457 1472 * @param array|string $args { … … 1493 1508 * 'authors'. Default empty. 1494 1509 * } 1495 * @return string |null Null on display. String of HTML content on retrieve.1510 * @return string String of HTML content. 1496 1511 */ 1497 1512 function wp_dropdown_users( $args = '' ) { … … 1582 1597 * @since 2.3.0 1583 1598 * 1584 * @param string $field The user Object field name.1585 * @param mixed $valueThe user Object value.1586 * @param int $user_id user ID.1599 * @param string $field The user Object field name. 1600 * @param mixed $value The user Object value. 1601 * @param int $user_id User ID. 1587 1602 * @param string $context How to sanitize user fields. Looks for 'raw', 'edit', 'db', 'display', 1588 * 'attribute' and 'js'.1603 * 'attribute' and 'js'. 1589 1604 * @return mixed Sanitized value. 1590 1605 */ … … 1720 1735 * 1721 1736 * @param string $username Username. 1722 * @return null|int The user's ID on success, and nullon failure.1737 * @return int|false The user's ID on success, and false on failure. 1723 1738 */ 1724 1739 function username_exists( $username ) { 1725 if ( $user = get_user_by( 'login', $username ) ) {1740 if ( $user = get_user_by( 'login', $username ) ) { 1726 1741 return $user->ID; 1727 } else { 1728 return null; 1729 } 1742 } 1743 return false; 1730 1744 } 1731 1745 … … 1736 1750 * 1737 1751 * @param string $email Email. 1738 * @return bool|intThe user's ID on success, and false on failure.1752 * @return int|false The user's ID on success, and false on failure. 1739 1753 */ 1740 1754 function email_exists( $email ) { 1741 if ( $user = get_user_by( 'email', $email) )1755 if ( $user = get_user_by( 'email', $email) ) { 1742 1756 return $user->ID; 1743 1757 } 1744 1758 return false; 1745 1759 } … … 2149 2163 * @param string $password The user's password. 2150 2164 * @param string $email Optional. The user's email. Default empty. 2151 * @return int The new user's ID.2165 * @return int|WP_Error The new user's ID. 2152 2166 */ 2153 2167 function wp_create_user($username, $password, $email = '') { … … 2296 2310 * Handles resetting the user's password. 2297 2311 * 2298 * @param object $user The user2312 * @param object $user The user 2299 2313 * @param string $new_pass New password for the user in plaintext 2300 2314 */
Note: See TracChangeset
for help on using the changeset viewer.