Automattic\WooCommerce\Admin\Features
Features::load_scripts
Loads the required scripts on the correct pages.
Method of the class: Features{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Features::load_scripts();
Features::load_scripts() Features::load scripts code WC 10.5.0
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' );
}