Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_initialize_site

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
96
97      /**
98       * Fires when a site's initialization routine should be executed.
99       *
100       * @since 5.1.0
101       *
102       * @param WP_Site $new_site New site object.
103       * @param array   $args     Arguments for the initialization.
104       */
105      do_action( 'wp_initialize_site', $new_site, $args );
106
107      // Only compute extra hook parameters if the deprecated hook is actually in use.
108      if ( has_action( 'wpmu_new_blog' ) ) {
109           $user_id = ! empty( $args['user_id'] ) ? $args['user_id'] : 0;
110           $meta    = ! empty( $args['options'] ) ? $args['options'] : array();
111
112           // WPLANG was passed with `$meta` to the `wpmu_new_blog` hook prior to 5.1.0.
113           if ( ! array_key_exists( 'WPLANG', $meta ) ) {
114                $meta['WPLANG'] = get_network_option( $new_site->network_id, 'WPLANG' );