Yoast\WP\SEO\Bulk_Editor\Application\Updates

Bulk_Updater::render_fields │ private │ Yoast 1.0

Renders the search fields with replacement variables resolved, for re-scoring after a save.

Only called for search updates; social updates carry no scored fields.

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

Хуков нет.

Возвращает

array<string, string>. The rendered fields, keyed by field.

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

// private - только в коде основоного (родительского) класса
$result = $this->render_fields( $type, $post_id ): array;
$type(Update_Type) (обязательный)
The appearance the update targets.
$post_id(int) (обязательный)
The ID of the post.

Код Bulk_Updater::render_fields() Yoast 28.9

private function render_fields( Update_Type $type, int $post_id ): array {
	if ( ! $type->is_search() ) {
		return [];
	}

	return [
		'seo_title'        => $this->field_renderer->render( $post_id, 'title' ),
		'meta_description' => $this->field_renderer->render( $post_id, 'metadesc' ),
	];
}