Yoast\WP\SEO\Actions\Importing\Aioseo
Aioseo_Posts_Importing_Action::post_general_robots_import()
Imports the post's robots setting.
Метод класса: Aioseo_Posts_Importing_Action{}
Хуков нет.
Возвращает
true|false|null
. The value of Yoast's noindex setting for the post.
Использование
$Aioseo_Posts_Importing_Action = new Aioseo_Posts_Importing_Action(); $Aioseo_Posts_Importing_Action->post_general_robots_import( $aioseo_robots_settings, $aioseo_key, $mapping );
- $aioseo_robots_settings(true|false) (обязательный)
- AIOSEO's set of robot settings for the post.
- $aioseo_key(строка) (обязательный)
- The AIOSEO key that contains the robot setting we're working with.
- $mapping(массив) (обязательный)
- The mapping of the setting we're working with.
Код Aioseo_Posts_Importing_Action::post_general_robots_import() Aioseo Posts Importing Action::post general robots import Yoast 22.4
public function post_general_robots_import( $aioseo_robots_settings, $aioseo_key, $mapping ) { $mapping = $this->enhance_mapping( $mapping ); if ( $aioseo_robots_settings['robots_default'] ) { // Let's first get the subtype's setting value and then transform it taking into consideration whether it defers to global defaults. $subtype_setting = $this->robots_provider->get_subtype_robot_setting( $mapping ); return $this->robots_transformer->transform_robot_setting( $mapping['robot_type'], $subtype_setting, $mapping ); } return $aioseo_robots_settings[ $aioseo_key ]; }