| @@ -105,8 +105,9 @@ | ||
| 105 | 105 | |
| 106 | 106 | // The SEO Overview column edits only the PRIMARY focus keyword. Take the |
| 107 | 107 | // new primary from the input (first value if a list is pasted) and keep |
| 108 | 108 | // the existing secondary keywords so inline editing never drops them. |
| 109 | + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- normalize() sanitize_text_field()s every value it keeps. | |
| 109 | 110 | $raw_input = isset($_POST['focus_keyword']) ? wp_unslash($_POST['focus_keyword']) : ''; |
| 110 | 111 | $new_primary = \ThinkRank\SEO\Focus_Keywords::normalize($raw_input, 1); |
| 111 | 112 | |
| 112 | 113 | $existing = \ThinkRank\SEO\Focus_Keywords::get($post_id); |
| @@ -133,9 +134,9 @@ | ||
| 133 | 134 | 'has_keyword' => !empty($keywords) |
| 134 | 135 | ]; |
| 135 | 136 | |
| 136 | 137 | // update post modified time |
| 137 | - $this->update_post_modified( $post_id ); | |
| 138 | + self::update_post_modified( $post_id ); | |
| 138 | 139 | |
| 139 | 140 | /** |
| 140 | 141 | * Filter the AJAX response data for focus keyword update |
| 141 | 142 | * |
| @@ -150,12 +151,14 @@ | ||
| 150 | 151 | |
| 151 | 152 | /** |
| 152 | 153 | * Force update post_modified and post_modified_gmt timestamps. |
| 153 | 154 | * |
| 155 | + * Static so sibling handlers (e.g. Seo_Quick_Edit_Ajax) can reuse it. | |
| 156 | + * | |
| 154 | 157 | * @param int $post_id |
| 155 | 158 | * @return bool |
| 156 | 159 | */ |
| 157 | - function update_post_modified( $post_id ) { | |
| 160 | + public static function update_post_modified( $post_id ) { | |
| 158 | 161 | |
| 159 | 162 | if ( ! $post_id || ! get_post( $post_id ) ) { |
| 160 | 163 | return false; |
| 161 | 164 | } |
| @@ -182,7 +185,5 @@ | ||
| 182 | 185 | clean_post_cache( $post_id ); |
| 183 | 186 | |
| 184 | 187 | return ( $updated !== false ); |
| 185 | 188 | } |
| 186 | - | |
| 187 | 189 | } |
| 188 | - | |