WPSEO_Replace_Vars::retrieve_term_description()privateYoast 1.0

Retrieve the term description for use as replacement string.

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

Хуков нет.

Возвращает

Строку|null.

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

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

Код WPSEO_Replace_Vars::retrieve_term_description() Yoast 22.3

private function retrieve_term_description() {
	$replacement = null;

	if ( ! empty( $this->args->term_id ) && ! empty( $this->args->taxonomy ) ) {
		$term_desc = get_term_field( 'description', $this->args->term_id, $this->args->taxonomy );
		if ( $term_desc !== '' ) {
			$replacement = wp_strip_all_tags( $term_desc );
		}
	}

	return $replacement;
}