site_allowed_themes
Filters the array of themes allowed on the site.
Usage
add_filter( 'site_allowed_themes', 'wp_kama_site_allowed_themes_filter', 10, 2 );
/**
* Function for `site_allowed_themes` filter-hook.
*
* @param string[] $allowed_themes An array of theme stylesheet names.
* @param int $blog_id ID of the site.
*
* @return string[]
*/
function wp_kama_site_allowed_themes_filter( $allowed_themes, $blog_id ){
// filter...
return $allowed_themes;
}
- $allowed_themes(string[])
- An array of theme stylesheet names.
- $blog_id(int)
- ID of the site.
Default: current site
Changelog
| Since 4.5.0 | Introduced. |
Where the hook is called
site_allowed_themes
wp-includes/class-wp-theme.php 1729
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );
wp-includes/class-wp-theme.php 1782
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );