← All changes
|
includes/api/class-content-type-matrix-endpoint.php
+15
-5
2.5.0
→
2.7.0
View file →
| @@ -284,18 +284,28 @@ | ||
| 284 | 284 | $manager = new \ThinkRank\SEO\Social_Meta_Manager(); |
| 285 | 285 | $social = $manager->get_settings('site'); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - $ga_measurement_id = (string) \ThinkRank\Core\Settings::instance()->get('ga4_measurement_id', ''); | |
| 289 | - $ga_auto_inject = (bool) \ThinkRank\Core\Settings::instance()->get('ga4_auto_inject', false); | |
| 290 | - | |
| 291 | - return [ | |
| 288 | + $defaults = [ | |
| 292 | 289 | Content_Type_Settings::FEATURE_META => true, |
| 293 | 290 | Content_Type_Settings::FEATURE_SCHEMA => true, |
| 294 | 291 | Content_Type_Settings::FEATURE_OPEN_GRAPH => !empty($social['enable_open_graph'] ?? $social['og_enabled'] ?? false), |
| 295 | 292 | Content_Type_Settings::FEATURE_TWITTER => !empty($social['enable_twitter_cards'] ?? $social['twitter_enabled'] ?? false), |
| 296 | - Content_Type_Settings::FEATURE_ANALYTICS => $ga_auto_inject && $ga_measurement_id !== '', | |
| 293 | + // The GA4 tag this switch gates is installed by ThinkRank Pro, | |
| 294 | + // which answers the filter below with its own site-wide state. | |
| 295 | + Content_Type_Settings::FEATURE_ANALYTICS => false, | |
| 297 | 296 | ]; |
| 297 | + | |
| 298 | + /** | |
| 299 | + * Filters the site-wide value each 'inherit' matrix cell resolves to. | |
| 300 | + * | |
| 301 | + * @since 2.6.0 | |
| 302 | + * | |
| 303 | + * @param array<string, bool> $defaults Feature key => site-wide value. | |
| 304 | + */ | |
| 305 | + $filtered = apply_filters('thinkrank_content_type_matrix_global_defaults', $defaults); | |
| 306 | + | |
| 307 | + return is_array($filtered) ? array_map('boolval', $filtered + $defaults) : $defaults; | |
| 298 | 308 | } |
| 299 | 309 | |
| 300 | 310 | /** |
| 301 | 311 | * Sitemap settings for the site context. |