populate_network_meta

Filters meta for a network on creation.

Description

apply_filters( 'populate_network_meta', (array) $sitemeta, (int) $network_id ); 

Parameters (2)

0. $sitemeta (array)
Associative array of network meta keys and values to be inserted.
1. $network_id (int)
ID of network to populate.

Usage

To run the hook, copy the example below.
  1. $sitemeta = apply_filters( 'populate_network_meta', $sitemeta, $network_id ); 
  2.  
  3. if ( !empty( $sitemeta ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the populate_network_meta callback 
  2. function filter_populate_network_meta( $sitemeta, $network_id ) { 
  3. // make filter magic happen here... 
  4. return $sitemeta
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'populate_network_meta', 'filter_populate_network_meta', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'populate_network_meta', 'filter_populate_network_meta', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/schema.php  
  1. $sitemeta = apply_filters( 'populate_network_meta', $sitemeta, $network_id );