Schema_Generator::protected_webpage_schema()publicYoast 1.0

Adapts the WebPage graph piece for password-protected posts.

It should only have certain whitelisted properties. The type should always be WebPage.

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

Хуков нет.


Массив. The WebPage graph piece that has been adapted for password-protected posts.


$Schema_Generator = new Schema_Generator();
$Schema_Generator->protected_webpage_schema( $graph_piece );
$graph_piece(массив) (обязательный)
The WebPage graph piece that should be adapted for password-protected posts.

Код Schema_Generator::protected_webpage_schema() Yoast 22.1

public function protected_webpage_schema( $graph_piece ) {
	$properties_to_show = \array_flip(

	$graph_piece          = \array_intersect_key( $graph_piece, $properties_to_show );
	$graph_piece['@type'] = 'WebPage';

	return $graph_piece;