Changeset 51738 for trunk/src/wp-includes/user.php
- Timestamp:
- 09/07/2021 09:30:07 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r51657 r51738 1712 1712 * @since 3.6.0 The `aim`, `jabber`, and `yim` fields were removed as default user contact 1713 1713 * methods for new installations. See wp_get_user_contact_methods(). 1714 * @since 4.7.0 The user's localecan be passed to `$userdata`.1714 * @since 4.7.0 The `locale` field can be passed to `$userdata`. 1715 1715 * @since 5.3.0 The `user_activation_key` field can be passed to `$userdata`. 1716 1716 * @since 5.3.0 The `spam` field can be passed to `$userdata` (Multisite only). 1717 * @since 5.9.0 The `meta_input` field can be passed to `$userdata` to allow addition of user meta data. 1717 1718 * 1718 1719 * @global wpdb $wpdb WordPress database abstraction object. … … 1759 1760 * @type string $role User's role. 1760 1761 * @type string $locale User's locale. Default empty. 1762 * @type array $meta_input Array of custom user meta values keyed by meta key. 1763 * Default empty. 1761 1764 * } 1762 1765 * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not … … 2058 2061 * 2059 2062 * Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`. 2063 * 2064 * For custom meta fields, see the {@see 'insert_custom_user_meta'} filter. 2060 2065 * 2061 2066 * @since 4.4.0 … … 2084 2089 */ 2085 2090 $meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata ); 2091 2092 $custom_meta = array(); 2093 if ( array_key_exists( 'meta_input', $userdata ) && is_array( $userdata['meta_input'] ) && ! empty( $userdata['meta_input'] ) ) { 2094 $custom_meta = $userdata['meta_input']; 2095 } 2096 2097 /** 2098 * Filters a user's custom meta values and keys immediately after the user is created or updated 2099 * and before any user meta is inserted or updated. 2100 * 2101 * For non-custom meta fields, see the {@see 'insert_user_meta'} filter. 2102 * 2103 * @since 5.9.0 2104 * 2105 * @param array $custom_meta Array of custom user meta values keyed by meta key. 2106 * @param WP_User $user User object. 2107 * @param bool $update Whether the user is being updated rather than created. 2108 * @param array $userdata The raw array of data passed to wp_insert_user(). 2109 */ 2110 $custom_meta = apply_filters( 'insert_custom_user_meta', $custom_meta, $user, $update, $userdata ); 2111 2112 $meta = array_merge( $meta, $custom_meta ); 2086 2113 2087 2114 // Update user meta.
Note: See TracChangeset
for help on using the changeset viewer.