Automattic\WooCommerce\Admin\Features
Features::load_scripts
Loads the required scripts on the correct pages.
Метод класса: Features{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = Features::load_scripts();
Код Features::load_scripts() Features::load scripts WC 10.8.1
public static function load_scripts() {
if ( ! PageController::is_admin_or_embed_page() ) {
return;
}
$features = self::get_features();
$enabled_features = array();
foreach ( $features as $key ) {
$enabled_features[ $key ] = self::is_enabled( $key );
}
wp_add_inline_script( WC_ADMIN_APP, 'window.wcAdminFeatures = ' . wp_json_encode( $enabled_features, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), 'before' );
}