site_allowed_themes хук-фильтрWP 4.5.0

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 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.