Yoast\WP\SEO\Builders

Indexable_Post_Builder::get_robots_noindex()protectedYoast 1.0

Converts the meta robots noindex value to the indexable value.

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

Хуков нет.

Возвращает

true|false|null. True for noindex, false for index, null for default of parent/type.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_robots_noindex( $value );
$value(int) (обязательный)
Meta value to convert.

Код Indexable_Post_Builder::get_robots_noindex() Yoast 22.4

protected function get_robots_noindex( $value ) {
	$value = (int) $value;

	switch ( $value ) {
		case 1:
			return true;
		case 2:
			return false;
	}

	return null;
}