Yoast\WP\SEO\Bulk_Editor\Infrastructure\Updates
Meta_Writer::write_score
Writes a per-field score for a post.
The score is routed through the same sanitization as a normal post save, which clamps it to a
0-100 integer.
Метод класса: Meta_Writer{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$Meta_Writer = new Meta_Writer(); $Meta_Writer->write_score( $post_id, $key, $score ): void;
- $post_id(int) (обязательный)
- The ID of the post.
- $key(строка) (обязательный)
- The score meta key (without prefix) to write.
- $score(int) (обязательный)
- The 0-100 score to write.
Код Meta_Writer::write_score() Meta Writer::write score Yoast 28.9
public function write_score( int $post_id, string $key, int $score ): void {
$this->write( $key, $post_id, (string) $score );
}