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