network_allowed_themes

Filters the array of themes allowed on the network.

Description

apply_filters( 'network_allowed_themes', (array) $self, (int) $blog_id ); 

Site is provided as context so that a list of network allowed themes can be filtered further.

Parameters (2)

0. $self (array) => self::get_allowed_on_network()
An array of theme stylesheet names.
1. $blog_id (int)
ID of the site.

Usage

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

Defined (1)

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

/wp-includes/class-wp-theme.php  
  1. $network = (array) apply_filters( 'network_allowed_themes', self::get_allowed_on_network(), $blog_id );