diff --git wp-includes/user.php wp-includes/user.php
index 9a60cd2..a96b612 100644
|
|
|
function wp_signon( $credentials = '', $secure_cookie = '' ) {
|
| 38 | 38 | $credentials['remember'] = false; |
| 39 | 39 | |
| 40 | 40 | // TODO do we deprecate the wp_authentication action? |
| | 41 | /** |
| | 42 | * Fires before the user is authenticated. |
| | 43 | * |
| | 44 | * The variables passed to the callbacks are passed by reference and can be modified by callback functions. |
| | 45 | * |
| | 46 | * @since 1.5.2 |
| | 47 | * |
| | 48 | * @param string $user_login. |
| | 49 | * @param string $user_password. |
| | 50 | */ |
| 41 | 51 | do_action_ref_array('wp_authenticate', array(&$credentials['user_login'], &$credentials['user_password'])); |
| 42 | 52 | |
| 43 | 53 | if ( '' === $secure_cookie ) |
| 44 | 54 | $secure_cookie = is_ssl(); |
| 45 | 55 | |
| | 56 | /** |
| | 57 | * Filters whether the sign-on cookie should only be transmitted over a secure HTTPS |
| | 58 | * connection from the client. |
| | 59 | * |
| | 60 | * @since 3.1.0 |
| | 61 | * |
| | 62 | * @param bool $secure_cookie When set to true, the cookie will only be set if a secure connection exists. |
| | 63 | * @param array $args { |
| | 64 | * User credentials. |
| | 65 | * |
| | 66 | * @type string $user_login Username. |
| | 67 | * @type string $user_password Password entered. |
| | 68 | * @type bool $remember Whether to 'remember' the user. Increases the time that the cookie will be kept. |
| | 69 | * } |
| | 70 | */ |
| 46 | 71 | $secure_cookie = apply_filters('secure_signon_cookie', $secure_cookie, $credentials); |
| 47 | 72 | |
| 48 | 73 | global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie |
| … |
… |
function wp_signon( $credentials = '', $secure_cookie = '' ) {
|
| 61 | 86 | } |
| 62 | 87 | |
| 63 | 88 | wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie); |
| 64 | | do_action('wp_login', $user->user_login, $user); |
| | 89 | |
| | 90 | $user_login = $user->user_login; |
| | 91 | /** |
| | 92 | * Triggered after the user has successfully logged in. |
| | 93 | * |
| | 94 | * @since 1.5.2 |
| | 95 | * |
| | 96 | * @param string $user_login The user's username. |
| | 97 | * @param WP_User $user The logged-in user. |
| | 98 | */ |
| | 99 | do_action('wp_login', $user_login, $user); |
| 65 | 100 | return $user; |
| 66 | 101 | } |
| 67 | 102 | |
| … |
… |
function wp_authenticate_username_password($user, $username, $password) {
|
| 92 | 127 | if ( !$user ) |
| 93 | 128 | return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() ) ); |
| 94 | 129 | |
| | 130 | /** |
| | 131 | * Filters whether the given user can be authenticated with the provided $password. |
| | 132 | * |
| | 133 | * This allows plug-ins to add additional authentication conditions. Please note that the filtered |
| | 134 | * value is originally a WP_User,but hooked callbacks may recieve a WP_Error if authentication has |
| | 135 | * failed in an earlier callback. |
| | 136 | * |
| | 137 | * @since 2.5.0 |
| | 138 | * |
| | 139 | * @param WP_User|WP_Error $user WP_User object or WP_Error object if a previous callback failed authentication. |
| | 140 | * @param string $password The password to check against the user. |
| | 141 | */ |
| 95 | 142 | $user = apply_filters('wp_authenticate_user', $user, $password); |
| 96 | 143 | if ( is_wp_error($user) ) |
| 97 | 144 | return $user; |
| … |
… |
function wp_authenticate_cookie($user, $username, $password) {
|
| 138 | 185 | */ |
| 139 | 186 | function wp_authenticate_spam_check( $user ) { |
| 140 | 187 | if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) { |
| 141 | | $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy(), $user ); |
| | 188 | $spammed = is_user_spammy(); |
| | 189 | /** |
| | 190 | * Filters whether the user has been marked as a spammer. |
| | 191 | * |
| | 192 | * @since 3.7.0 |
| | 193 | * |
| | 194 | * @param bool $spammed True if the user is considered a spammer. |
| | 195 | * @param WP_User $user The user to check against. |
| | 196 | */ |
| | 197 | $spammed = apply_filters( 'check_is_user_spammed', $spammed, $user ); |
| 142 | 198 | |
| 143 | 199 | if ( $spammed ) |
| 144 | 200 | return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) ); |
| … |
… |
function count_user_posts($userid) {
|
| 162 | 218 | |
| 163 | 219 | $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); |
| 164 | 220 | |
| | 221 | /** |
| | 222 | * Filters the number of posts a user has written. |
| | 223 | * |
| | 224 | * @since 2.7.0 |
| | 225 | * |
| | 226 | * @param int $count The number of posts the user has posted. |
| | 227 | * @param int $userid The ID of the user. |
| | 228 | */ |
| 165 | 229 | return apply_filters('get_usernumposts', $count, $userid); |
| 166 | 230 | } |
| 167 | 231 | |
| … |
… |
function get_user_option( $option, $user = 0, $deprecated = '' ) {
|
| 256 | 320 | else |
| 257 | 321 | $result = false; |
| 258 | 322 | |
| | 323 | /** |
| | 324 | * Filter a specific option value for a user. |
| | 325 | * |
| | 326 | * `$option` in this filter refers to the user option name. |
| | 327 | * |
| | 328 | * @since 2.5.0 |
| | 329 | * |
| | 330 | * @param mixed $result The value for the user's option. |
| | 331 | * @param string $option The name of the option being retrieved. |
| | 332 | * @param WP_User $user User object of the user whose option is being retrieved. |
| | 333 | */ |
| 259 | 334 | return apply_filters("get_user_option_{$option}", $result, $option, $user); |
| 260 | 335 | } |
| 261 | 336 | |
| … |
… |
class WP_User_Query {
|
| 494 | 569 | $search_columns = array('user_login', 'user_nicename'); |
| 495 | 570 | } |
| 496 | 571 | |
| | 572 | /** |
| | 573 | * Filters the columns which are searched in a WP_User_Query search. |
| | 574 | * |
| | 575 | * The default colummns depend on the search term and include `user_email`, |
| | 576 | * `user_login`, `ID`, `user_url` and `user_nicename`. |
| | 577 | * |
| | 578 | * @since 3.6.0 |
| | 579 | * |
| | 580 | * @param array $search_columns Array of column names to be searched. |
| | 581 | * @param string $search The term being searched. |
| | 582 | * @param WP_User_Query $this The current WP_User_Query. |
| | 583 | */ |
| 497 | 584 | $search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this ); |
| 498 | 585 | |
| 499 | 586 | $this->query_where .= $this->get_search_sql( $search, $search_columns, $wild ); |
| … |
… |
class WP_User_Query {
|
| 546 | 633 | $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)"; |
| 547 | 634 | } |
| 548 | 635 | |
| | 636 | /** |
| | 637 | * Triggered after the WP_User_Query has been parsed and before the query is executed. |
| | 638 | * |
| | 639 | * The passed WP_User_Query object contains SQL parts formed from parsing the given query. |
| | 640 | * |
| | 641 | * @since 1.5.2 |
| | 642 | * |
| | 643 | * @param WP_User_Query $this The user query, passed by reference. |
| | 644 | */ |
| 549 | 645 | do_action_ref_array( 'pre_user_query', array( &$this ) ); |
| 550 | 646 | } |
| 551 | 647 | |
| … |
… |
class WP_User_Query {
|
| 566 | 662 | $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"); |
| 567 | 663 | } |
| 568 | 664 | |
| | 665 | /** |
| | 666 | * Filters the SQL command for number of users matching the WP_User_Query |
| | 667 | * |
| | 668 | * @since 3.2.0 |
| | 669 | * |
| | 670 | * @param string $sql The SQL command to count the number of matching users. |
| | 671 | */ |
| 569 | 672 | if ( isset( $qv['count_total'] ) && $qv['count_total'] ) |
| 570 | | $this->total_users = $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) ); |
| | 673 | $sql = 'SELECT FOUND_ROWS()'; |
| | 674 | $this->total_users = $wpdb->get_var( apply_filters( 'found_users_query', $sql ) ); |
| 571 | 675 | |
| 572 | 676 | if ( !$this->results ) |
| 573 | 677 | return; |
| … |
… |
function get_blogs_of_user( $user_id, $all = false ) {
|
| 774 | 878 | } |
| 775 | 879 | } |
| 776 | 880 | |
| | 881 | /** |
| | 882 | * Filters the blogs belonging to the specified user. |
| | 883 | * |
| | 884 | * @since 3.1.0 |
| | 885 | * |
| | 886 | * @param array $blogs An array of blog objects belonging to the user. |
| | 887 | * @param int $user_id The ID of the user. |
| | 888 | * @param bool $all True if $blogs should conain all blogs, false if it should only |
| | 889 | * contain blogs that are not marked as deleted, archived, or spam. |
| | 890 | */ |
| 777 | 891 | return apply_filters( 'get_blogs_of_user', $blogs, $user_id, $all ); |
| 778 | 892 | } |
| 779 | 893 | |
| … |
… |
function wp_dropdown_users( $args = '' ) {
|
| 1092 | 1206 | |
| 1093 | 1207 | $output .= "</select>"; |
| 1094 | 1208 | } |
| 1095 | | |
| | 1209 | |
| | 1210 | /** |
| | 1211 | * Filters the HTML of a dropdown of users. |
| | 1212 | * |
| | 1213 | * @since 2.3.0 |
| | 1214 | * |
| | 1215 | * @param string $output HTML generated by `wp_dropdown_users()`. |
| | 1216 | */ |
| 1096 | 1217 | $output = apply_filters('wp_dropdown_users', $output); |
| 1097 | 1218 | |
| 1098 | 1219 | if ( $echo ) |
| … |
… |
function sanitize_user_field($field, $value, $user_id, $context) {
|
| 1138 | 1259 | |
| 1139 | 1260 | if ( 'edit' == $context ) { |
| 1140 | 1261 | if ( $prefixed ) { |
| | 1262 | //duplicate hook |
| 1141 | 1263 | $value = apply_filters("edit_{$field}", $value, $user_id); |
| 1142 | 1264 | } else { |
| | 1265 | /** |
| | 1266 | * Filter and sanitize the value of the prefixed field (for editing). |
| | 1267 | * |
| | 1268 | * The dynamic portion of the hook name, $field, refers to the prefixed |
| | 1269 | * user field being filtered, such as 'user_login', 'user_email', |
| | 1270 | * 'first_name', etc. |
| | 1271 | * |
| | 1272 | * @since 2.9.0 |
| | 1273 | * |
| | 1274 | * @param mixed $value Value of the prefixed user field. |
| | 1275 | * @param int $user_id The user ID. |
| | 1276 | */ |
| 1143 | 1277 | $value = apply_filters("edit_user_{$field}", $value, $user_id); |
| 1144 | 1278 | } |
| 1145 | 1279 | |
| … |
… |
function sanitize_user_field($field, $value, $user_id, $context) {
|
| 1149 | 1283 | $value = esc_attr($value); |
| 1150 | 1284 | } else if ( 'db' == $context ) { |
| 1151 | 1285 | if ( $prefixed ) { |
| | 1286 | //Dupicate hook |
| 1152 | 1287 | $value = apply_filters("pre_{$field}", $value); |
| 1153 | 1288 | } else { |
| | 1289 | /** |
| | 1290 | * Filter and sanitize the value of the prefixed field (for database use). |
| | 1291 | * |
| | 1292 | * The dynamic portion of the hook name, $field, refers to the prefixed |
| | 1293 | * user field being filtered, such as 'user_login', 'user_email', |
| | 1294 | * 'first_name', etc. |
| | 1295 | * |
| | 1296 | * @since 2.9.0 |
| | 1297 | * |
| | 1298 | * @param mixed $value Value of the prefixed user field. |
| | 1299 | */ |
| 1154 | 1300 | $value = apply_filters("pre_user_{$field}", $value); |
| 1155 | 1301 | } |
| 1156 | 1302 | } else { |
| 1157 | 1303 | // Use display filters by default. |
| 1158 | | if ( $prefixed ) |
| | 1304 | if ( $prefixed ){ |
| | 1305 | //Duplicate hook |
| 1159 | 1306 | $value = apply_filters($field, $value, $user_id, $context); |
| 1160 | | else |
| | 1307 | }else{ |
| | 1308 | /** |
| | 1309 | * Filter and sanitize the value of the prefixed field (for other contexts). |
| | 1310 | * |
| | 1311 | * The dynamic portion of the hook name, $field, refers to the prefixed |
| | 1312 | * user field being filtered, such as 'user_login', 'user_email', |
| | 1313 | * 'first_name', etc. |
| | 1314 | * |
| | 1315 | * @since 2.9.0 |
| | 1316 | * |
| | 1317 | * @param mixed $value The user object value to sanitize. |
| | 1318 | * @param int $user_id The User ID. |
| | 1319 | * @param string $context The context to filter for. |
| | 1320 | */ |
| 1161 | 1321 | $value = apply_filters("user_{$field}", $value, $user_id, $context); |
| | 1322 | } |
| 1162 | 1323 | } |
| 1163 | 1324 | |
| 1164 | 1325 | if ( 'user_url' == $field ) |
| … |
… |
function email_exists( $email ) {
|
| 1250 | 1411 | function validate_username( $username ) { |
| 1251 | 1412 | $sanitized = sanitize_user( $username, true ); |
| 1252 | 1413 | $valid = ( $sanitized == $username ); |
| | 1414 | /** |
| | 1415 | * Filters whether the provided username is valid or not. |
| | 1416 | * |
| | 1417 | * @since 2.0.11 |
| | 1418 | * |
| | 1419 | * @param bool $valid Whether username given is valid. |
| | 1420 | * @param string $username The username to check. |
| | 1421 | */ |
| 1253 | 1422 | return apply_filters( 'validate_username', $valid, $username ); |
| 1254 | 1423 | } |
| 1255 | 1424 | |
| … |
… |
function wp_insert_user( $userdata ) {
|
| 1321 | 1490 | } |
| 1322 | 1491 | |
| 1323 | 1492 | $user_login = sanitize_user($user_login, true); |
| | 1493 | /** |
| | 1494 | * Filters the username after it has been sanitized, but before the user is created or updated. |
| | 1495 | * |
| | 1496 | * This hook is called before the user is created or updated. |
| | 1497 | * |
| | 1498 | * @since 2.0.11 |
| | 1499 | * |
| | 1500 | * @param string $user_login The username after it has been sanitized. |
| | 1501 | */ |
| 1324 | 1502 | $user_login = apply_filters('pre_user_login', $user_login); |
| 1325 | 1503 | |
| 1326 | 1504 | //Remove any non-printable chars from the login string to see if we have ended up with an empty username |
| … |
… |
function wp_insert_user( $userdata ) {
|
| 1334 | 1512 | |
| 1335 | 1513 | if ( empty($user_nicename) ) |
| 1336 | 1514 | $user_nicename = sanitize_title( $user_login ); |
| | 1515 | |
| | 1516 | /** |
| | 1517 | * Filters the user's nicename before the user is created or updated. |
| | 1518 | * |
| | 1519 | * This hook is called before the user is created or updated. |
| | 1520 | * |
| | 1521 | * @since 2.0.11 |
| | 1522 | * |
| | 1523 | * @param string $user_nicename The user's nicename. |
| | 1524 | */ |
| 1337 | 1525 | $user_nicename = apply_filters('pre_user_nicename', $user_nicename); |
| 1338 | 1526 | |
| 1339 | 1527 | if ( empty($user_url) ) |
| 1340 | 1528 | $user_url = ''; |
| | 1529 | |
| | 1530 | /** |
| | 1531 | * Filters the user's url before the user is created or updated. |
| | 1532 | * |
| | 1533 | * @since 2.0.11 |
| | 1534 | * |
| | 1535 | * @param string $user_url The user's url. |
| | 1536 | */ |
| 1341 | 1537 | $user_url = apply_filters('pre_user_url', $user_url); |
| 1342 | 1538 | |
| 1343 | 1539 | if ( empty($user_email) ) |
| 1344 | 1540 | $user_email = ''; |
| | 1541 | |
| | 1542 | /** |
| | 1543 | * Filters the user's email before the user is created or updated. |
| | 1544 | * |
| | 1545 | * @since 2.0.11 |
| | 1546 | * |
| | 1547 | * @param string $user_email The user's email. |
| | 1548 | */ |
| 1345 | 1549 | $user_email = apply_filters('pre_user_email', $user_email); |
| 1346 | 1550 | |
| 1347 | 1551 | if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) ) |
| … |
… |
function wp_insert_user( $userdata ) {
|
| 1349 | 1553 | |
| 1350 | 1554 | if ( empty($nickname) ) |
| 1351 | 1555 | $nickname = $user_login; |
| | 1556 | |
| | 1557 | /** |
| | 1558 | * Filters the user's nickname before the user is created or updated. |
| | 1559 | * |
| | 1560 | * @since 2.0.11 |
| | 1561 | * |
| | 1562 | * @param string $nickname The user's nickname. |
| | 1563 | */ |
| 1352 | 1564 | $nickname = apply_filters('pre_user_nickname', $nickname); |
| 1353 | 1565 | |
| 1354 | 1566 | if ( empty($first_name) ) |
| 1355 | 1567 | $first_name = ''; |
| | 1568 | |
| | 1569 | /** |
| | 1570 | * Filters the user's first name before the user is created or updated. |
| | 1571 | * |
| | 1572 | * @since 2.0.11 |
| | 1573 | * |
| | 1574 | * @param string $first_name The user's first name. |
| | 1575 | */ |
| 1356 | 1576 | $first_name = apply_filters('pre_user_first_name', $first_name); |
| 1357 | 1577 | |
| 1358 | 1578 | if ( empty($last_name) ) |
| 1359 | 1579 | $last_name = ''; |
| | 1580 | |
| | 1581 | /** |
| | 1582 | * Filters the user's last name before the user is created or updated. |
| | 1583 | * |
| | 1584 | * @since 2.0.11 |
| | 1585 | * |
| | 1586 | * @param string $last_name The user's last name. |
| | 1587 | */ |
| 1360 | 1588 | $last_name = apply_filters('pre_user_last_name', $last_name); |
| 1361 | 1589 | |
| 1362 | 1590 | if ( empty( $display_name ) ) { |
| … |
… |
function wp_insert_user( $userdata ) {
|
| 1372 | 1600 | else |
| 1373 | 1601 | $display_name = $user_login; |
| 1374 | 1602 | } |
| | 1603 | |
| | 1604 | /** |
| | 1605 | * Filters the user's display name before the user is created or updated. |
| | 1606 | * |
| | 1607 | * @since 2.0.11 |
| | 1608 | * |
| | 1609 | * @param string $display_name The user's display name. |
| | 1610 | */ |
| 1375 | 1611 | $display_name = apply_filters( 'pre_user_display_name', $display_name ); |
| 1376 | 1612 | |
| 1377 | 1613 | if ( empty($description) ) |
| 1378 | 1614 | $description = ''; |
| | 1615 | |
| | 1616 | /** |
| | 1617 | * Filters the user's description before the user is created or updated. |
| | 1618 | * |
| | 1619 | * @since 2.0.11 |
| | 1620 | * |
| | 1621 | * @param string $description The user's description. |
| | 1622 | */ |
| 1379 | 1623 | $description = apply_filters('pre_user_description', $description); |
| 1380 | 1624 | |
| 1381 | 1625 | if ( empty($rich_editing) ) |
| … |
… |
function wp_insert_user( $userdata ) {
|
| 1435 | 1679 | wp_cache_delete($user_id, 'users'); |
| 1436 | 1680 | wp_cache_delete($user_login, 'userlogins'); |
| 1437 | 1681 | |
| 1438 | | if ( $update ) |
| | 1682 | if ( $update ){ |
| | 1683 | /** |
| | 1684 | * Triggered after the user is updated. |
| | 1685 | * |
| | 1686 | * @since 2.0.0 |
| | 1687 | * |
| | 1688 | * @param int $user_id The user ID. |
| | 1689 | * @param object $old_user_data User's data prior to update as a raw object. |
| | 1690 | */ |
| 1439 | 1691 | do_action('profile_update', $user_id, $old_user_data); |
| 1440 | | else |
| | 1692 | }else{ |
| | 1693 | /** |
| | 1694 | * Triggered after the user is created. |
| | 1695 | * |
| | 1696 | * @since 1.5.2 |
| | 1697 | * |
| | 1698 | * @param int $user_id The user ID |
| | 1699 | */ |
| 1441 | 1700 | do_action('user_register', $user_id); |
| | 1701 | } |
| 1442 | 1702 | |
| 1443 | 1703 | return $user_id; |
| 1444 | 1704 | } |
| … |
… |
function check_password_reset_key($key, $login) {
|
| 1648 | 1908 | * @param string $new_pass New password for the user in plaintext |
| 1649 | 1909 | */ |
| 1650 | 1910 | function reset_password( $user, $new_pass ) { |
| | 1911 | |
| | 1912 | /** |
| | 1913 | * Triggered before the user's password is reset to $new_pass. |
| | 1914 | * |
| | 1915 | * @since Unknown |
| | 1916 | * |
| | 1917 | * @param int $user_id The user ID. |
| | 1918 | * @param object $old_user_data User's data prior to update as a raw object. |
| | 1919 | */ |
| 1651 | 1920 | do_action( 'password_reset', $user, $new_pass ); |
| 1652 | | |
| | 1921 | //@since is uknown but exists before 1.5 |
| 1653 | 1922 | wp_set_password( $new_pass, $user->ID ); |
| 1654 | 1923 | update_user_option( $user->ID, 'default_password_nag', false, true ); |
| 1655 | 1924 | |
| … |
… |
function register_new_user( $user_login, $user_email ) {
|
| 1667 | 1936 | $errors = new WP_Error(); |
| 1668 | 1937 | |
| 1669 | 1938 | $sanitized_user_login = sanitize_user( $user_login ); |
| | 1939 | /** |
| | 1940 | * Filters the email address of a user being registered. |
| | 1941 | * |
| | 1942 | * This hooks is triggered before the user is created. |
| | 1943 | * |
| | 1944 | * @since 2.1.0 |
| | 1945 | * |
| | 1946 | * @param string $user_email The email of the new user. |
| | 1947 | */ |
| 1670 | 1948 | $user_email = apply_filters( 'user_registration_email', $user_email ); |
| 1671 | 1949 | |
| 1672 | 1950 | // Check the username |
| … |
… |
function register_new_user( $user_login, $user_email ) {
|
| 1689 | 1967 | $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) ); |
| 1690 | 1968 | } |
| 1691 | 1969 | |
| | 1970 | /** |
| | 1971 | * Triggered when registration form data is submitted, and before the user has been created. |
| | 1972 | * |
| | 1973 | * @since 2.1.0 |
| | 1974 | * |
| | 1975 | * @param string $sanitized_user_login The submitted username after sanitization. |
| | 1976 | * @param string $user_email The submitted email. |
| | 1977 | * @param WP_Error $errors Contains any errors with the submitted username and |
| | 1978 | * email (e.g. invalid, already exists). |
| | 1979 | */ |
| 1692 | 1980 | do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); |
| 1693 | 1981 | |
| | 1982 | /** |
| | 1983 | * Filters the errors encountered when a new user is beng registerered. |
| | 1984 | * |
| | 1985 | * The filtered WP_Error object may, for example, contain errors for an invalid |
| | 1986 | * or existing username or email. A WP_Error object should always returned, but |
| | 1987 | * may or may not contain errors. |
| | 1988 | * |
| | 1989 | * If any errors are present in $errors, this will abort the user's registration. |
| | 1990 | * |
| | 1991 | * @since 2.1.0 |
| | 1992 | * |
| | 1993 | * @param WP_Error $errors A WP_Error object which contains any errors encountered during registration. |
| | 1994 | * @param string $sanitized_user_login The user's username after it has been sanitized. |
| | 1995 | * @param string $user_email The user's email. |
| | 1996 | */ |
| 1694 | 1997 | $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email ); |
| 1695 | 1998 | |
| 1696 | 1999 | if ( $errors->get_error_code() ) |