Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: insert_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
2048       *     @type int|bool $use_ssl              Whether to force SSL on the user's admin area. 0|false if SSL
2049       *                                          is not forced.
2050       *     @type string   $show_admin_bar_front Whether to show the admin bar on the front end for the user.
2051       *                                          Default 'true'.
2052       *     @type string   $locale               User's locale. Default empty.
2053       * }
2054       * @param WP_User $user   User object.
2055       * @param bool    $update Whether the user is being updated rather than created.
2056       */
2057      $meta = apply_filters( 'insert_user_meta', $meta, $user, $update );
2058
2059      // Update user meta.
2060      foreach ( $meta as $key => $value ) {
2061           update_user_meta( $user_id, $key, $value );
2062      }
2063
2064      foreach ( wp_get_user_contact_methods( $user ) as $key => $value ) {
2065           if ( isset( $userdata[ $key ] ) ) {
2066                update_user_meta( $user_id, $key, $userdata[ $key ] );