Yoast\WP\SEO\Generators\Schema

FAQ::add_accepted_answer_property()protectedYoast 1.0

Adds the Questions acceptedAnswer property.

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

Хуков нет.

Возвращает

Массив. Schema.org Question piece.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_accepted_answer_property( $question );
$question(массив) (обязательный)
The question to add the acceptedAnswer to.

Код FAQ::add_accepted_answer_property() Yoast 22.3

protected function add_accepted_answer_property( $question ) {
	$data = [
		'@type' => 'Answer',
		'text'  => $this->helpers->schema->html->sanitize( $question['jsonAnswer'] ),
	];

	return $this->helpers->schema->language->add_piece_language( $data );
}