wp_initialize_site_args
Filter HookDescription
Filters the arguments for initializing a site.Hook Information
| File Location | 
                                wp-includes/ms-site.php
                                
                                    View on GitHub
                                
                             | 
                        
| Hook Type | Filter | 
| Line Number | 694 | 
                        
Hook Parameters
| Type | Name | Description | 
|---|---|---|
                                    array
                                 | 
                                
                                    $args
                                 | 
                                Arguments to modify the initialization behavior. | 
                                    WP_Site
                                 | 
                                
                                    $site
                                 | 
                                Site that is being initialized. | 
                                    WP_Network
                                 | 
                                
                                    $network
                                 | 
                                Network that the site belongs to. | 
Usage Examples
                        Basic Usage
                    
                    <?php
// Hook into wp_initialize_site_args
add_filter('wp_initialize_site_args', 'my_custom_filter', 10, 3);
function my_custom_filter($args, $site, $network) {
    // Your custom filtering logic here
    return $args;
}
                        
                    Source Code Context
                        wp-includes/ms-site.php:694
                        - How this hook is used in WordPress core
                    
                    <?php
 689  	 *
 690  	 * @param array      $args    Arguments to modify the initialization behavior.
 691  	 * @param WP_Site    $site    Site that is being initialized.
 692  	 * @param WP_Network $network Network that the site belongs to.
 693  	 */
 694  	$args = apply_filters( 'wp_initialize_site_args', $args, $site, $network );
 695  
 696  	$orig_installing = wp_installing();
 697  	if ( ! $orig_installing ) {
 698  		wp_installing( true );
 699  	}
                    PHP Documentation
<?php
/**
	 * Filters the arguments for initializing a site.
	 *
	 * @since 5.1.0
	 *
	 * @param array      $args    Arguments to modify the initialization behavior.
	 * @param WP_Site    $site    Site that is being initialized.
	 * @param WP_Network $network Network that the site belongs to.
	 */
                
            
                        Quick Info
                    
                    - Hook Type: Filter
 - Parameters: 3
 - File: wp-includes/ms-site.php
 
                        Related Hooks
                    
                    Related hooks will be displayed here in future updates.