Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_blog

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
69      $blog = get_blog_details( $blog_id );
70      /**
71       * Fires before a blog is deleted.
72       *
73       * @since MU
74       *
75       * @param int  $blog_id The blog ID.
76       * @param bool $drop    True if blog's table should be dropped. Default is false.
77       */
78      do_action( 'delete_blog', $blog_id, $drop );
79
80      $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) );
81
82      // Remove users from this blog.
83      if ( ! empty( $users ) ) {
84           foreach ( $users as $user_id ) {
85                remove_user_from_blog( $user_id, $blog_id );
86           }
87      }