PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / bulk-editor / application / updates / meta-writer-interface.php

meta-writer-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at src/bulk-editor/application/updates/meta-writer-interface.php

60 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\Bulk_Editor\Application\Updates;
5
6 use Yoast\WP\SEO\Bulk_Editor\Domain\Updates\Update_Type;
7
8 /**
9 * Describes how the bulk updater persists a title, description and focus keyphrase for a post.
10 */
11 interface Meta_Writer_Interface {
12
13 /**
14 * Writes the title for a post.
15 *
16 * @param Update_Type $type The appearance the title belongs to.
17 * @param int $post_id The ID of the post.
18 * @param string $title The title to write.
19 *
20 * @return void
21 */
22 public function write_title( Update_Type $type, int $post_id, string $title ): void;
23
24 /**
25 * Writes the description for a post.
26 *
27 * @param Update_Type $type The appearance the description belongs to.
28 * @param int $post_id The ID of the post.
29 * @param string $description The description to write.
30 *
31 * @return void
32 */
33 public function write_description( Update_Type $type, int $post_id, string $description ): void;
34
35 /**
36 * Writes the focus keyphrase for a post. The focus keyphrase is channel-agnostic,
37 * so it does not depend on the update type.
38 *
39 * Returns the sanitized value that was actually stored, so callers can detect
40 * when the input was silently altered (e.g. HTML stripped by sanitize_text_field).
41 *
42 * @param int $post_id The ID of the post.
43 * @param string $focus_keyphrase The focus keyphrase to write.
44 *
45 * @return string The sanitized focus keyphrase that was persisted.
46 */
47 public function write_focus_keyphrase( int $post_id, string $focus_keyphrase ): string;
48
49 /**
50 * Writes a per-field score for a post.
51 *
52 * @param int $post_id The ID of the post.
53 * @param string $key The score meta key (without prefix) to write.
54 * @param int $score The 0-100 score to write.
55 *
56 * @return void
57 */
58 public function write_score( int $post_id, string $key, int $score ): void;
59 }
60