Yoast\WP\SEO\Actions\Importing\Aioseo

Aioseo_Custom_Archive_Settings_Importing_Action::build_mapping()protectedYoast 1.0

Builds the mapping that ties AOISEO option keys with Yoast ones and their data transformation method.

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

Хуков нет.

Возвращает

null. Ничего.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->build_mapping();

Код Aioseo_Custom_Archive_Settings_Importing_Action::build_mapping() Yoast 20.0

protected function build_mapping() {
	$post_type_objects = \get_post_types( [ 'public' => true ], 'objects' );

	foreach ( $post_type_objects as $pt ) {
		// Use all the custom post types that have archives.
		if ( ! $pt->_builtin && $this->post_type->has_archive( $pt ) ) {
			$this->aioseo_options_to_yoast_map[ '/' . $pt->name . '/title' ]                       = [
				'yoast_name'       => 'title-ptarchive-' . $pt->name,
				'transform_method' => 'simple_import',
			];
			$this->aioseo_options_to_yoast_map[ '/' . $pt->name . '/metaDescription' ]             = [
				'yoast_name'       => 'metadesc-ptarchive-' . $pt->name,
				'transform_method' => 'simple_import',
			];
			$this->aioseo_options_to_yoast_map[ '/' . $pt->name . '/advanced/robotsMeta/noindex' ] = [
				'yoast_name'       => 'noindex-ptarchive-' . $pt->name,
				'transform_method' => 'import_noindex',
				'type'             => 'archives',
				'subtype'          => $pt->name,
				'option_name'      => 'aioseo_options_dynamic',
			];
		}
	}
}