site_allowed_themes filter-hookWP 4.5.0

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

WP_Theme::get_allowed_on_site()
site_allowed_themes
wp-includes/class-wp-theme.php 1719
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );
wp-includes/class-wp-theme.php 1772
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );

Where the hook is used in WordPress

Usage not found.