Yoast\WP\SEO\Bulk_Editor\Infrastructure\Updates

Meta_Writer::write_focus_keyphrase │ public │ Yoast 1.0

Writes the focus keyphrase for a post. The focus keyphrase is channel-agnostic, so it does not depend on the update type.

Returns the sanitized value that was actually stored, so callers can detect when the input was silently altered (e.g. HTML stripped by sanitize_text_field).

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

Хуков нет.

Возвращает

string. The sanitized focus keyphrase that was persisted.

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

$Meta_Writer = new Meta_Writer();
$Meta_Writer->write_focus_keyphrase( $post_id, $focus_keyphrase ): string;
$post_id(int) (обязательный)
The ID of the post.
$focus_keyphrase(строка) (обязательный)
The focus keyphrase to write.

Код Meta_Writer::write_focus_keyphrase() Yoast 28.9

public function write_focus_keyphrase( int $post_id, string $focus_keyphrase ): string {
	return $this->write( 'focuskw', $post_id, $focus_keyphrase );
}