Automattic\WooCommerce\Internal\Admin
WCAdminAssets::inject_wc_settings_dependencies()
Injects wp-shared-settings as a dependency if it's present.
Метод класса: WCAdminAssets{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$WCAdminAssets = new WCAdminAssets(); $WCAdminAssets->inject_wc_settings_dependencies();
Код WCAdminAssets::inject_wc_settings_dependencies() WCAdminAssets::inject wc settings dependencies WC 7.3.0
public function inject_wc_settings_dependencies() { if ( wp_script_is( 'wc-settings', 'registered' ) ) { $handles_for_injection = [ 'wc-csv', 'wc-currency', 'wc-customer-effort-score', 'wc-navigation', // NOTE: This should be removed when Gutenberg is updated and // the notices package is removed from WooCommerce Admin. 'wc-notices', 'wc-number', 'wc-date', 'wc-components', 'wc-tracks', ]; foreach ( $handles_for_injection as $handle ) { $script = wp_scripts()->query( $handle, 'registered' ); if ( $script instanceof _WP_Dependency ) { $script->deps[] = 'wc-settings'; } } } }