Yoast\WP\SEO\Actions\Importing\Aioseo

Aioseo_Taxonomy_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_Taxonomy_Settings_Importing_Action{}

Хуков нет.

Возвращает

null. Ничего.

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

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

Код Aioseo_Taxonomy_Settings_Importing_Action::build_mapping() Yoast 19.11

protected function build_mapping() {
	$taxonomy_objects = \get_taxonomies( [ 'public' => true ], 'object' );

	foreach ( $taxonomy_objects as $tax ) {
		// Use all the public taxonomies.
		$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/title' ]                       = [
			'yoast_name'       => 'title-tax-' . $tax->name,
			'transform_method' => 'simple_import',
		];
		$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/metaDescription' ]             = [
			'yoast_name'       => 'metadesc-tax-' . $tax->name,
			'transform_method' => 'simple_import',
		];
		$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/advanced/robotsMeta/noindex' ] = [
			'yoast_name'       => 'noindex-tax-' . $tax->name,
			'transform_method' => 'import_noindex',
			'type'             => 'taxonomies',
			'subtype'          => $tax->name,
			'option_name'      => 'aioseo_options_dynamic',
		];
	}
}