site_allowed_themes

Filters the array of themes allowed on the site.

Description

apply_filters( 'site_allowed_themes', (array) $allowed_themes_blog_id, (int) $blog_id ); 

Parameters (2)

0. $allowed_themes_blog_id (array)
An array of theme stylesheet names.
1. $blog_id (int)
ID of the site. Defaults to current site.

Usage

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

Defined (2)

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

/wp-includes/class-wp-theme.php  
  1. return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id ); 
  1. return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );