Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: insert_custom_user_meta

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2389       * For non-custom meta fields, see the {@see 'insert_user_meta'} filter.
2390       *
2391       * @since 5.9.0
2392       *
2393       * @param array   $custom_meta Array of custom user meta values keyed by meta key.
2394       * @param WP_User $user        User object.
2395       * @param bool    $update      Whether the user is being updated rather than created.
2396       * @param array   $userdata    The raw array of data passed to wp_insert_user().
2397       */
2398      $custom_meta = apply_filters( 'insert_custom_user_meta', $custom_meta, $user, $update, $userdata );
2399
2400      $meta = array_merge( $meta, $custom_meta );
2401
2402      // Update user meta.
2403      foreach ( $meta as $key => $value ) {
2404           update_user_meta( $user_id, $key, $value );
2405      }
2406
2407      foreach ( wp_get_user_contact_methods( $user ) as $key => $value ) {