Automattic\WooCommerce\Internal\Admin\Settings

SettingsUIRequestContext::resolve_script_handlesprivateWC 1.0

Resolve extension script handles.

Метод класса: SettingsUIRequestContext{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->resolve_script_handles(): void;

Код SettingsUIRequestContext::resolve_script_handles() WC 10.9.1

private function resolve_script_handles(): void {
	$this->script_handles_resolved = true;
	$this->script_handles          = array();

	if ( ! $this->settings_ui_page ) {
		return;
	}

	try {
		$this->script_handles = self::filter_script_handles( $this->settings_ui_page->get_script_handles( $this->section ) );
	} catch ( \Throwable $e ) {
		$this->script_handles_failed = true;

		wc_get_logger()->debug(
			sprintf(
				'Settings UI script handles could not be resolved for page "%1$s" section "%2$s": %3$s: %4$s',
				$this->get_page_id(),
				'' === $this->section ? self::DEFAULT_SECTION_KEY : $this->section,
				get_class( $e ),
				$e->getMessage()
			),
			array( 'source' => 'settings-ui' )
		);

		if ( $e instanceof \Exception ) {
			$this->script_handles_failure_reason = sprintf(
				/* translators: %s: exception message. */
				__( 'Settings UI script handles could not be resolved: %s', 'woocommerce' ),
				$e->getMessage()
			);
			wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__ );
		}
	}
}