Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_user_login

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
256
257      if ( ! current_user_can('create_users') )
258           wp_die(__('You can’t create users.'));
259
260      $user_id = add_user();
261      $update = 'add';
262      if ( is_wp_error( $user_id ) )
263           $add_user_errors = $user_id;
264      else {
265           $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true));
266           $redirect = add_query_arg( array('usersearch' => urlencode($new_user_login), 'update' => $update), $redirect );
267           wp_redirect( $redirect . '#user-' . $user_id );
268           die();
269      }
270
271 default:
272      wp_enqueue_script('admin-users');
273
274      include('admin-header.php');