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
168
169      if ( ! current_user_can('create_users') )
170           wp_die(__('You can’t create users.'));
171
172      $user_id = add_user();
173      $update = 'add';
174      if ( is_wp_error( $user_id ) )
175           $add_user_errors = $user_id;
176      else {
177           $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true));
178           $redirect = add_query_arg( array('usersearch' => urlencode($new_user_login), 'update' => $update), $redirect );
179           wp_redirect( $redirect . '#user-' . $user_id );
180           die();
181      }
182
183 default:
184
185      if ( !empty($_GET['_wp_http_referer']) ) {
186           wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));