PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.9.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.9.0
2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 All 50 releases
← All changes | includes/api/class-instant-indexing-endpoint.php +17 -9 2.1.1 → 2.9.0 View file →
@@ -349,18 +349,26 @@
349 349 if (empty($params)) {
350 350 $params = $request->get_params(); // Fallback if content-type is not JSON
351 351 }
352 352
353 - // Sanitize Post Types
354 - $post_types = isset($params['auto_submit_post_types']) ? (array) $params['auto_submit_post_types'] : [];
355 - $sanitized_post_types = array_map('sanitize_text_field', $post_types);
353 + $current_settings = get_option($this->option_name, []);
354 + if (!is_array($current_settings)) {
355 + $current_settings = [];
356 + }
357 + $new_settings = $current_settings;
356 358
357 - // We generally don't let user update API Key directly via update_settings,
358 - // they should use regenerate, but if we need to support manual entry:
359 - $current_settings = get_option($this->option_name, []);
360 - $new_settings = array_merge($current_settings, [
361 - 'auto_submit_post_types' => $sanitized_post_types
362 - ]);
359 + // Only write the post types when the caller actually sent them. Writing
360 + // unconditionally meant a payload of {"enabled": true} cleared the list,
361 + // so the feature came on with nothing to submit — and diverged from the
362 + // MCP ability, which writes this same option with an array_key_exists()
363 + // merge. An explicit empty array still clears, since isset() is true
364 + // for one (#562).
365 + if (isset($params['auto_submit_post_types'])) {
366 + $new_settings['auto_submit_post_types'] = array_values(array_map(
367 + 'sanitize_key',
368 + (array) $params['auto_submit_post_types']
369 + ));
370 + }
363 371
364 372 // Save enabled state
365 373 if (isset($params['enabled'])) {
366 374 $new_settings['enabled'] = rest_sanitize_boolean($params['enabled']);