WPSEO_Import_WPSEO::import_post_robot()privateYoast 1.0

Gets the wpSEO robot value and map this to Yoast SEO values.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->import_post_robot( $post_id );
$post_id(int) (обязательный)
The post id of the current post.

Код WPSEO_Import_WPSEO::import_post_robot() Yoast 22.4

private function import_post_robot( $post_id ) {
	$wpseo_robots = get_post_meta( $post_id, '_wpseo_edit_robots', true );
	$robot_value  = $this->get_robot_value( $wpseo_robots );

	// Saving the new meta values for Yoast SEO.
	$this->maybe_save_post_meta( 'meta-robots-noindex', $robot_value['index'], $post_id );
	$this->maybe_save_post_meta( 'meta-robots-nofollow', $robot_value['follow'], $post_id );
}