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
2418       * For non-custom meta fields, see the {@see 'insert_user_meta'} filter.
2419       *
2420       * @since 5.9.0
2421       *
2422       * @param array   $custom_meta Array of custom user meta values keyed by meta key.
2423       * @param WP_User $user        User object.
2424       * @param bool    $update      Whether the user is being updated rather than created.
2425       * @param array   $userdata    The raw array of data passed to wp_insert_user().
2426       */
2427      $custom_meta = apply_filters( 'insert_custom_user_meta', $custom_meta, $user, $update, $userdata );
2428
2429      $meta = array_merge( $meta, $custom_meta );
2430
2431      // Update user meta.
2432      foreach ( $meta as $key => $value ) {
2433           update_user_meta( $user_id, $key, $value );
2434      }
2435
2436      foreach ( wp_get_user_contact_methods( $user ) as $key => $value ) {