WPSEO_Import_SEOPressor::import_post_robots()privateYoast 1.0

Retrieves the SEOpressor robot value and map this to Yoast SEO values.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->import_post_robots( $meta_rules, $post_id );
$meta_rules(строка) (обязательный)
The meta rules taken from the SEOpressor settings array.
$post_id(int) (обязательный)
The post id of the current post.

Код WPSEO_Import_SEOPressor::import_post_robots() Yoast 22.4

private function import_post_robots( $meta_rules, $post_id ) {
	$seopressor_robots = explode( '#|#|#', $meta_rules );
	$robot_value       = $this->get_robot_value( $seopressor_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 );
	$this->maybe_save_post_meta( 'meta-robots-adv', $robot_value['advanced'], $post_id );
}