post_type = $post_type; } /** * Builds the mapping that ties AOISEO option keys with Yoast ones and their data transformation method. * * @return void */ 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', ]; } } } }