Yoast\WP\SEO\Actions\Importing\Aioseo

Abstract_Aioseo_Settings_Importing_Action::query()protectedYoast 1.0

Queries the database and retrieves unimported AiOSEO settings (in chunks if a limit is applied).

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

Хуков нет.

Возвращает

Массив. The (maybe chunked) unimported AiOSEO settings to import.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->query( $limit );
$limit(int|null)
The maximum number of unimported objects to be returned.
По умолчанию: null

Код Abstract_Aioseo_Settings_Importing_Action::query() Yoast 22.4

protected function query( $limit = null ) {
	$aioseo_settings = \json_decode( \get_option( $this->get_source_option_name(), '' ), true );

	if ( empty( $aioseo_settings ) ) {
		return [];
	}

	// We specifically want the setttings of the tab we're working with, eg. postTypes, taxonomies, etc.
	$settings_values = $aioseo_settings['searchAppearance'][ $this->settings_tab ];
	if ( ! \is_array( $settings_values ) ) {
		return [];
	}

	$flattened_settings = $this->import_helper->flatten_settings( $settings_values );

	return $this->get_unimported_chunk( $flattened_settings, $limit );
}