PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.10.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.10.0
2.11.0 2.10.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 All 52 releases
← All changes | includes/seo/class-global-seo-post-types.php +23 -0 2.3.0 → 2.10.0 View file →
@@ -58,8 +58,31 @@
58 58 return !in_array($object->name, self::excluded_post_types($object), true);
59 59 }
60 60
61 61 /**
62 + * Every post type that passes {@see self::is_allowed()}.
63 + *
64 + * The sitewide half of duplicate snippet detection needs the whole list
65 + * rather than one name, because a duplicate title is a duplicate whichever
66 + * post type the other page happens to be (#564).
67 + *
68 + * @since 2.10.0
69 + *
70 + * @return string[] Post type names.
71 + */
72 + public static function allowed(): array {
73 + $allowed = [];
74 +
75 + foreach (get_post_types(['public' => true], 'objects') as $object) {
76 + if (self::is_allowed($object)) {
77 + $allowed[] = $object->name;
78 + }
79 + }
80 +
81 + return $allowed;
82 + }
83 +
84 + /**
62 85 * Builder and utility CPTs that are not optimizable content.
63 86 *
64 87 * These register `public => true` for preview purposes but are layout
65 88 * fragments, not pages anyone gives a title and a meta description.