Yoast\WP\SEO\Dashboard\Application\Configuration

Dashboard_Configuration::get_configurationpublicYoast 1.0

Returns a configuration

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

Хуков нет.

Возвращает

Массив<Строку,. array<string>|array<string, string|array<string, array<string, int>>>>

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

$Dashboard_Configuration = new Dashboard_Configuration();
$Dashboard_Configuration->get_configuration(): array;

Код Dashboard_Configuration::get_configuration() Yoast 27.4

public function get_configuration(): array {
	$configuration = [
		'contentTypes'            => $this->content_types_repository->get_content_types(),
		'indexablesEnabled'       => $this->indexable_helper->should_index_indexables(),
		'displayName'             => $this->user_helper->get_current_user_display_name(),
		'enabledAnalysisFeatures' => $this->enabled_analysis_features_repository->get_features_by_keys(
			[
				Readability_Analysis::NAME,
				Keyphrase_Analysis::NAME,
			],
		)->to_array(),
		'endpoints'               => $this->endpoints_repository->get_all_endpoints()->to_array(),
		'nonce'                   => $this->nonce_repository->get_rest_nonce(),
		'setupStepsTracking'      => $this->setup_steps_tracking->to_array(),
	];

	$site_kit_integration_data = $this->site_kit_integration_data->to_array();
	if ( ! empty( $site_kit_integration_data ) ) {
		$configuration['siteKitConfiguration'] = $site_kit_integration_data;
	}

	$browser_cache_configuration = $this->browser_cache_configuration->get_configuration();
	if ( ! empty( $browser_cache_configuration ) ) {
		$configuration['browserCache'] = $browser_cache_configuration;
	}

	return $configuration;
}