Yoast\WP\SEO\Bulk_Editor\Infrastructure\Updates
Meta_Writer::write
Sanitizes and persists a value under the given meta key.
Returns the sanitized value so callers that need the stored value (e.g. to echo it back in the REST response) do not have to re-read from the database.
Метод класса: Meta_Writer{}
Хуков нет.
Возвращает
string. The sanitized value that was persisted.
Использование
// private - только в коде основоного (родительского) класса $result = $this->write( $key, $post_id, $value ): string;
- $key(строка) (обязательный)
- The meta key (without prefix) to store the value under.
- $post_id(int) (обязательный)
- The ID of the post.
- $value(строка) (обязательный)
- The value to write.
Код Meta_Writer::write() Meta Writer::write Yoast 28.9
private function write( string $key, int $post_id, string $value ): string {
$sanitized = $this->sanitize( $key, $value );
$this->meta_helper->set_value( $key, $sanitized, $post_id );
return $sanitized;
}