pre_prepare_themes_for_js хук-фильтрWP 4.2.0

Filters theme data before it is prepared for JavaScript.

Passing a non-empty array will result in wp_prepare_themes_for_js() returning early with that value instead.

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

add_filter( 'pre_prepare_themes_for_js', 'wp_kama_pre_prepare_themes_for_js_filter', 10, 3 );

/**
 * Function for `pre_prepare_themes_for_js` filter-hook.
 * 
 * @param array           $prepared_themes An associative array of theme data.
 * @param WP_Theme[]|null $themes          An array of theme objects to prepare, if any.
 * @param string          $current_theme   The active theme slug.
 *
 * @return array
 */
function wp_kama_pre_prepare_themes_for_js_filter( $prepared_themes, $themes, $current_theme ){

	// filter...
	return $prepared_themes;
}
$prepared_themes(массив)
An associative array of theme data.
По умолчанию: empty array
$themes(WP_Theme[]|null)
An array of theme objects to prepare, if any.
$current_theme(строка)
The active theme slug.

Список изменений

С версии 4.2.0 Введена.

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

wp_prepare_themes_for_js()
pre_prepare_themes_for_js
wp-admin/includes/theme.php 659
$prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );

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

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