Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_wp_is_site_initialized

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
929       *
930       * Returning a non-null value will effectively short-circuit the function, returning
931       * that value instead.
932       *
933       * @since 5.1.0
934       *
935       * @param bool|null $pre     The value to return, if not null.
936       * @param int       $site_id The site ID that is being checked.
937       */
938      $pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id );
939      if ( null !== $pre ) {
940           return (bool) $pre;
941      }
942
943      $switch = false;
944      if ( get_current_blog_id() !== $site_id ) {
945           $switch = true;
946           remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );
947           switch_to_blog( $site_id );