Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wpmu_update_blog_options

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
304           if ( !empty( $_POST['newuser'] ) ) {
305                $newuser = $_POST['newuser'];
306                $userid = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->users . " WHERE user_login = %s", $newuser ) );
307                if ( $userid ) {
308                     $user = $wpdb->get_var( "SELECT user_id FROM " . $wpdb->usermeta . " WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'" );
309                     if ( $user == false )
310                          add_user_to_blog( $id, $userid, $_POST['new_role'] );
311                }
312           }
313           do_action( 'wpmu_update_blog_options' );
314           restore_current_blog();
315           wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'editblog', 'id' => $id ), wp_get_referer() ) );
316      break;
317
318      case 'deleteblog':
319           check_admin_referer('deleteblog');
320           if ( ! current_user_can( 'manage_sites' ) )
321                wp_die( __( 'You do not have permission to access this page.' ) );
322