Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_pre_insert_user_data

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
1683       *     @type string $user_url        The user's url.
1684       *     @type string $user_nicename   The user's nice name. Defaults to a URL-safe version of user's login
1685       *     @type string $display_name    The user's display name.
1686       *     @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to
1687       *                                   the current UTC timestamp.
1688       * }
1689       * @param bool     $update Whether the user is being updated rather than created.
1690       * @param int|null $id     ID of the user to be updated, or NULL if the user is being created.
1691       */
1692      $data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null );
1693
1694      if ( $update ) {
1695           if ( $user_email !== $old_user_data->user_email ) {
1696                $data['user_activation_key'] = '';
1697           }
1698           $wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
1699           $user_id = (int) $ID;
1700      } else {
1701           $wpdb->insert( $wpdb->users, $data );