<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32637] trunk/src/wp-includes/user.php: Add missing doc blocks to `user.php`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32637">32637</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32637","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-28 15:50:34 +0000 (Thu, 28 May 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Add missing doc blocks to `user.php`.
`username_exists()` should return `false` instead of `null`, just like `email_exists()` does, which is right under it.
See <a href="https://core.trac.wordpress.org/ticket/32444">#32444</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/user.php 2015-05-28 15:38:44 UTC (rev 32636)
+++ trunk/src/wp-includes/user.php 2015-05-28 15:50:34 UTC (rev 32637)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,6 +19,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global string $auth_secure_cookie
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $credentials Optional. User info in order to sign on.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|bool $secure_cookie Optional. Whether to use secure cookie.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,6 +163,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global string $auth_secure_cookie
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User|WP_Error|null $user WP_User or WP_Error object from a previous callback. Default null.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $username Username. If not empty, cancels the cookie authentication.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $password Password. If not empty, cancels the cookie authentication.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,8 +235,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int|bool $user_id The user ID (or false) as received from the
</span><span class="cx" style="display: block; padding: 0 10px"> * determine_current_user filter.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int|bool User ID if validated, false otherwise. If a user ID from
- * an earlier filter callback is received, that value is returned.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false User ID if validated, false otherwise. If a user ID from
+ * an earlier filter callback is received, that value is returned.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_validate_logged_in_cookie( $user_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $user_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -287,6 +291,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global wpdb $wpdb
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $users Array of user IDs.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $post_type Optional. Single post type or array of post types to check. Defaults to 'post'.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $public_only Optional. Only return counts for public posts. Defaults to false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -517,6 +523,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * for `$orderby` parameter.
</span><span class="cx" style="display: block; padding: 0 10px"> * @access public
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global wpdb $wpdb
+ * @global int $blog_id
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $query {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Array or string of Query parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -901,10 +910,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access protected
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global wpdb $wpdb
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $string
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $cols
- * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for
- * single site. Single site allows leading and trailing wildcards, Network Admin only trailing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $cols
+ * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for single site.
+ * Single site allows leading and trailing wildcards, Network Admin only trailing.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function get_search_sql( $string, $cols, $wild = false ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -959,7 +970,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database abstraction object.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $orderby Alias for the field to order by.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|bool Value to used in the ORDER clause, if `$orderby` is valid. False otherwise.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string Value to used in the ORDER clause, if `$orderby` is valid.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function parse_orderby( $orderby ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1091,7 +1102,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param callable $name Method to call.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $arguments Arguments to pass when calling.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return mixed|bool Return value of the callback, false otherwise.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return mixed Return value of the callback, false otherwise.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __call( $name, $arguments ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'get_search_sql' === $name ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1257,11 +1268,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://codex.wordpress.org/Function_Reference/add_user_meta
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $user_id User ID.
- * @param string $meta_key Metadata name.
- * @param mixed $meta_value Metadata value.
- * @param bool $unique Optional, default is false. Whether the same key should not be added.
- * @return int|bool Meta ID on success, false on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $user_id User ID.
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Metadata value.
+ * @param bool $unique Optional, default is false. Whether the same key should not be added.
+ * @return int|false Meta ID on success, false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return add_metadata('user', $user_id, $meta_key, $meta_value, $unique);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1277,9 +1288,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://codex.wordpress.org/Function_Reference/delete_user_meta
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $user_id user ID
- * @param string $meta_key Metadata name.
- * @param mixed $meta_value Optional. Metadata value.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $user_id User ID
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Optional. Metadata value.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function delete_user_meta($user_id, $meta_key, $meta_value = '') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1292,11 +1303,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://codex.wordpress.org/Function_Reference/get_user_meta
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $user_id User ID.
- * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
- * @param bool $single Whether to return a single value.
- * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
- * is true.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $user_id User ID.
+ * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys.
+ * @param bool $single Whether to return a single value.
+ * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_user_meta($user_id, $key = '', $single = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return get_metadata('user', $user_id, $key, $single);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1313,10 +1323,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @link https://codex.wordpress.org/Function_Reference/update_user_meta
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param int $user_id User ID.
- * @param string $meta_key Metadata key.
- * @param mixed $meta_value Metadata value.
- * @param mixed $prev_value Optional. Previous value to check before removing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $user_id User ID.
+ * @param string $meta_key Metadata key.
+ * @param mixed $meta_value Metadata value.
+ * @param mixed $prev_value Optional. Previous value to check before removing.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1332,6 +1342,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Using $strategy = 'memory' this is memory-intensive and should handle around 10^5 users, but see WP Bug #12257.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @global wpdb $wpdb
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $strategy 'time' or 'memory'
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array Includes a grand total and an array of counts indexed by role strings.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1406,12 +1419,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by wp_set_current_user() for back compat. Might be deprecated in the future.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.4
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @global string $userdata User description.
- * @global string $user_login The user username for logging in
- * @global int $user_level The level of the user
- * @global int $user_ID The ID of the user
- * @global string $user_email The email address of the user
- * @global string $user_url The url in the user's profile
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @global string $user_login The user username for logging in
+ * @global object $userdata User data.
+ * @global int $user_level The level of the user
+ * @global int $user_ID The ID of the user
+ * @global string $user_email The email address of the user
+ * @global string $user_url The url in the user's profile
</ins><span class="cx" style="display: block; padding: 0 10px"> * @global string $user_identity The display name of the user
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $for_user_id Optional. User ID to set up global data.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1453,6 +1467,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global wpdb $wpdb WordPress database object for queries.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @global int $blog_id
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|string $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Array or string of arguments to generate a drop-down of users.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1492,7 +1507,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $who Which type of users to query. Accepts only an empty string or
</span><span class="cx" style="display: block; padding: 0 10px"> * 'authors'. Default empty.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|null Null on display. String of HTML content on retrieve.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return string String of HTML content.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_dropdown_users( $args = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $defaults = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1581,11 +1596,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $field The user Object field name.
- * @param mixed $value The user Object value.
- * @param int $user_id user ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $field The user Object field name.
+ * @param mixed $value The user Object value.
+ * @param int $user_id User ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $context How to sanitize user fields. Looks for 'raw', 'edit', 'db', 'display',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 'attribute' and 'js'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 'attribute' and 'js'.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return mixed Sanitized value.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function sanitize_user_field($field, $value, $user_id, $context) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1719,14 +1734,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $username Username.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return null|int The user's ID on success, and null on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false The user's ID on success, and false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function username_exists( $username ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $user = get_user_by('login', $username ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $user = get_user_by( 'login', $username ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $user->ID;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return null;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1735,12 +1749,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $email Email.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool|int The user's ID on success, and false on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|false The user's ID on success, and false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function email_exists( $email ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $user = get_user_by('email', $email) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $user = get_user_by( 'email', $email) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $user->ID;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2148,7 +2162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $username The user's username.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $password The user's password.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $email Optional. The user's email. Default empty.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int The new user's ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|WP_Error The new user's ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_create_user($username, $password, $email = '') {
</span><span class="cx" style="display: block; padding: 0 10px"> $user_login = wp_slash( $username );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2295,7 +2309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Handles resetting the user's password.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param object $user The user
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object $user The user
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $new_pass New password for the user in plaintext
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function reset_password( $user, $new_pass ) {
</span></span></pre>
</div>
</div>
</body>
</html>