site_allowed_themes
Filters the array of themes allowed on the site.
Использование
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.
По умолчанию: current site
Список изменений
С версии 4.5.0 | Введена. |
Где вызывается хук
site_allowed_themes
wp-includes/class-wp-theme.php 1714
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );
wp-includes/class-wp-theme.php 1767
return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );