WPSEO_Replace_Vars::retrieve_tag()privateYoast 1.0

Retrieve the current tag/tags for use as replacement string.

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

Хуков нет.

Возвращает

Строку|null.

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

// private - только в коде основоного (родительского) класса
$result = $this->retrieve_tag();

Код WPSEO_Replace_Vars::retrieve_tag() Yoast 22.4

private function retrieve_tag() {
	$replacement = null;

	if ( ! empty( $this->args->ID ) ) {
		$tags = $this->get_terms( $this->args->ID, 'post_tag' );
		if ( $tags !== '' ) {
			$replacement = $tags;
		}
	}

	return $replacement;
}