← All changes
|
src/bulk-editor/application/updates/meta-writer-interface.php
+15
-1
28.1
→
trunk
View file →
| @@ -35,11 +35,25 @@ | ||
| 35 | 35 | /** |
| 36 | 36 | * Writes the focus keyphrase for a post. The focus keyphrase is channel-agnostic, |
| 37 | 37 | * so it does not depend on the update type. |
| 38 | 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 | + * | |
| 39 | 42 | * @param int $post_id The ID of the post. |
| 40 | 43 | * @param string $focus_keyphrase The focus keyphrase to write. |
| 41 | 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 | + * | |
| 42 | 56 | * @return void |
| 43 | 57 | */ |
| 44 | - public function write_focus_keyphrase( int $post_id, string $focus_keyphrase ): void; | |
| 58 | + public function write_score( int $post_id, string $key, int $score ): void; | |
| 45 | 59 | } |