PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 19.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v19.0
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / config / schema-types.php

schema-types.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 19.0, at src/config/schema-types.php

186 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Config;
4
5 /**
6 * Class Schema_Types.
7 */
8 class Schema_Types {
9
10 /**
11 * Holds the possible schema page types.
12 *
13 * Capitalized in this way so the value can be directly used in the schema output.
14 *
15 * @var string[]
16 */
17 const PAGE_TYPES = [
18 'WebPage' => '',
19 'ItemPage' => '',
20 'AboutPage' => '',
21 'FAQPage' => '',
22 'QAPage' => '',
23 'ProfilePage' => '',
24 'ContactPage' => '',
25 'MedicalWebPage' => '',
26 'CollectionPage' => '',
27 'CheckoutPage' => '',
28 'RealEstateListing' => '',
29 'SearchResultsPage' => '',
30 ];
31
32 /**
33 * Holds the possible schema article types.
34 *
35 * Capitalized in this way so the value can be directly used in the schema output.
36 *
37 * @var string[]
38 */
39 const ARTICLE_TYPES = [
40 'Article' => '',
41 'BlogPosting' => '',
42 'SocialMediaPosting' => '',
43 'NewsArticle' => '',
44 'AdvertiserContentArticle' => '',
45 'SatiricalArticle' => '',
46 'ScholarlyArticle' => '',
47 'TechArticle' => '',
48 'Report' => '',
49 'None' => '',
50 ];
51
52 /**
53 * Gets the page type options.
54 *
55 * @return array[] The schema page type options.
56 */
57 public function get_page_type_options() {
58 return [
59 [
60 'name' => \__( 'Web Page', 'wordpress-seo' ),
61 'value' => 'WebPage',
62 ],
63 [
64 'name' => \__( 'Item Page', 'wordpress-seo' ),
65 'value' => 'ItemPage',
66 ],
67 [
68 'name' => \__( 'About Page', 'wordpress-seo' ),
69 'value' => 'AboutPage',
70 ],
71 [
72 'name' => \__( 'FAQ Page', 'wordpress-seo' ),
73 'value' => 'FAQPage',
74 ],
75 [
76 'name' => \__( 'QA Page', 'wordpress-seo' ),
77 'value' => 'QAPage',
78 ],
79 [
80 'name' => \__( 'Profile Page', 'wordpress-seo' ),
81 'value' => 'ProfilePage',
82 ],
83 [
84 'name' => \__( 'Contact Page', 'wordpress-seo' ),
85 'value' => 'ContactPage',
86 ],
87 [
88 'name' => \__( 'Medical Web Page', 'wordpress-seo' ),
89 'value' => 'MedicalWebPage',
90 ],
91 [
92 'name' => \__( 'Collection Page', 'wordpress-seo' ),
93 'value' => 'CollectionPage',
94 ],
95 [
96 'name' => \__( 'Checkout Page', 'wordpress-seo' ),
97 'value' => 'CheckoutPage',
98 ],
99 [
100 'name' => \__( 'Real Estate Listing', 'wordpress-seo' ),
101 'value' => 'RealEstateListing',
102 ],
103 [
104 'name' => \__( 'Search Results Page', 'wordpress-seo' ),
105 'value' => 'SearchResultsPage',
106 ],
107 ];
108 }
109
110 /**
111 * Gets the article type options.
112 *
113 * @return array[] The schema article type options.
114 */
115 public function get_article_type_options() {
116 /**
117 * Filter: 'wpseo_schema_article_types_labels' - Allow developers to filter the available article types and their labels.
118 *
119 * Make sure when you filter this to also filter `wpseo_schema_article_types`.
120 *
121 * @api array $schema_article_types_labels The available schema article types and their labels.
122 */
123 return \apply_filters(
124 'wpseo_schema_article_types_labels',
125 [
126 [
127 'name' => \__( 'Article', 'wordpress-seo' ),
128 'value' => 'Article',
129 ],
130 [
131 'name' => \__( 'Blog Post', 'wordpress-seo' ),
132 'value' => 'BlogPosting',
133 ],
134 [
135 'name' => \__( 'Social Media Posting', 'wordpress-seo' ),
136 'value' => 'SocialMediaPosting',
137 ],
138 [
139 'name' => \__( 'News Article', 'wordpress-seo' ),
140 'value' => 'NewsArticle',
141 ],
142 [
143 'name' => \__( 'Advertiser Content Article', 'wordpress-seo' ),
144 'value' => 'AdvertiserContentArticle',
145 ],
146 [
147 'name' => \__( 'Satirical Article', 'wordpress-seo' ),
148 'value' => 'SatiricalArticle',
149 ],
150 [
151 'name' => \__( 'Scholarly Article', 'wordpress-seo' ),
152 'value' => 'ScholarlyArticle',
153 ],
154 [
155 'name' => \__( 'Tech Article', 'wordpress-seo' ),
156 'value' => 'TechArticle',
157 ],
158 [
159 'name' => \__( 'Report', 'wordpress-seo' ),
160 'value' => 'Report',
161 ],
162 [
163 'name' => \__( 'None', 'wordpress-seo' ),
164 'value' => 'None',
165 ],
166 ]
167 );
168 }
169
170 /**
171 * Gets the values of the article type options.
172 *
173 * @return array[] The values of the Schema article type options.
174 */
175 public function get_article_type_options_values() {
176 $article_types = $this->get_article_type_options();
177 $article_type_values = [];
178
179 foreach ( $article_types as $type ) {
180 $article_type_values[] = $type['value'];
181 }
182
183 return $article_type_values;
184 }
185 }
186