Automattic\WooCommerce\Internal\Admin

WCAdminAssets::get_settings_ui_script_dependenciesprivateWC 1.0

Get extension script handles that must load before the settings embed app mounts.

Method of the class: WCAdminAssets{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_settings_ui_script_dependencies(): array;

WCAdminAssets::get_settings_ui_script_dependencies() code WC 10.9.4

private function get_settings_ui_script_dependencies(): array {
	try {
		if ( ! class_exists( SettingsUIRequestContext::class ) ) {
			return array();
		}

		$context = SettingsUIRequestContext::get_current();
	} catch ( \Throwable $e ) {
		return array();
	}

	if ( ! $context ) {
		return array();
	}

	$dependencies = array_merge(
		array( 'wc-settings-ui' ),
		$context->get_script_handles()
	);

	return array_values( array_unique( $dependencies ) );
}