Automattic\WooCommerce\Internal\Admin

WCAdminAssets::inject_wc_settings_dependencies()publicWC 1.0

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() WC 6.6.1

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';
			}
		}
	}
}