PluginProbe
WPSSO Core – Complete Schema Markup and Meta Tags / 22.7.0
WPSSO Core – Complete Schema Markup and Meta Tags v22.7.0
22.7.0 22.6.1 22.6.0 22.5.3 22.5.2 22.5.1 22.4.0 22.3.0 22.2.1 22.2.0 22.1.3 22.1.2 22.1.1 22.1.0 22.0.0 21.13.3 21.13.2 trunk 21.13.1
← All changes | lib/std/admin/advanced.php +1579 -0 22.5.222.7.0 View file →
@@ -1,0 +1,1579 @@
1 +<?php
2 +/*
3 + * License: GPLv3
4 + * License URI: https://www.gnu.org/licenses/gpl.txt
5 + * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/)
6 + */
7 +
8 +if ( ! defined( 'ABSPATH' ) ) {
9 +
10 + die( 'These aren\'t the droids you\'re looking for.' );
11 +}
12 +
13 +if ( ! class_exists( 'WpssoStdAdminAdvanced' ) ) {
14 +
15 + class WpssoStdAdminAdvanced {
16 +
17 + private $p; // Wpsso class object.
18 +
19 + private $html_tag_shown = array(); // Cache for HTML tags already shown.
20 +
21 + public function __construct( &$plugin ) {
22 +
23 + $this->p =& $plugin;
24 +
25 + $this->p->util->add_plugin_filters( $this, array(
26 + 'mb_advanced_plugin_integration_rows' => array( // Plugin Settings > Integration tab.
27 + 'mb_advanced_plugin_integration_rows' => 3,
28 + 'mb_site_advanced_plugin_integration_rows' => 3,
29 + ),
30 + 'mb_advanced_plugin_default_text_rows' => 3, // Plugin Settings > Default Text tab.
31 + 'mb_advanced_plugin_image_sizes_rows' => 3, // Plugin Settings > Image Sizes tab.
32 + 'mb_advanced_plugin_interface_rows' => 3, // Plugin Settings > Interface tab.
33 + 'mb_advanced_services_media_rows' => 3, // Service APIs > Media Services tab.
34 + 'mb_advanced_services_shortening_rows' => 3, // Service APIs > Shortening Services tab.
35 + 'mb_advanced_services_ratings_reviews_rows' => 3, // Service APIs > Ratings and Reviews tab.
36 + 'mb_advanced_doc_types_og_types_rows' => 3, // Document Types > Open Graph tab.
37 + 'mb_advanced_doc_types_schema_types_rows' => 3, // Document Types > Schema tab.
38 + 'mb_advanced_schema_defs_article_rows' => 3, // Schema Defaults > Article tab.
39 + 'mb_advanced_schema_defs_book_rows' => 3, // Schema Defaults > Book tab.
40 + 'mb_advanced_schema_defs_creative_work_rows' => 3, // Schema Defaults > Creative Work tab.
41 + 'mb_advanced_schema_defs_event_rows' => 3, // Schema Defaults > Event tab.
42 + 'mb_advanced_schema_defs_job_posting_rows' => 3, // Schema Defaults > Job Posting tab.
43 + 'mb_advanced_schema_defs_place_rows' => 3, // Schema Defaults > Place tab.
44 + 'mb_advanced_schema_defs_product_rows' => 3, // Schema Defaults > Product tab.
45 + 'mb_advanced_schema_defs_profile_page_rows' => 3, // Schema Defaults > Profile Page tab.
46 + 'mb_advanced_schema_defs_review_rows' => 3, // Schema Defaults > Review tab.
47 + 'mb_advanced_schema_defs_service_rows' => 3, // Schema Defaults > Service tab.
48 + 'mb_advanced_contact_fields_default_cm_rows' => 3, // Contact Fields > Default Contacts tab.
49 + 'mb_advanced_contact_fields_custom_cm_rows' => 3, // Contact Fields > Custom Contacts tab.
50 + 'mb_advanced_user_about_rows' => 3, // About the User metabox.
51 + 'mb_advanced_metadata_product_attrs_rows' => 3, // Attributes and Metadata > Product Attributes tab.
52 + 'mb_advanced_metadata_custom_fields_rows' => 3, // Attributes and Metadata > Custom Fields tab.
53 + 'mb_advanced_head_tags_facebook_rows' => 3, // HTML Tags > Facebook tab.
54 + 'mb_advanced_head_tags_open_graph_rows' => 3, // HTML Tags > Open Graph tab.
55 + 'mb_advanced_head_tags_twitter_rows' => 3, // HTML Tags > X (Twitter) tab.
56 + 'mb_advanced_head_tags_seo_other_rows' => 3, // HTML Tags > SEO / Other tab.
57 + ) );
58 + }
59 +
60 + /*
61 + * Plugin Settings > Integration tab.
62 + */
63 + public function filter_mb_advanced_plugin_integration_rows( $table_rows, $form, $args ) {
64 +
65 + /*
66 + * WpssoMessages->maybe_doc_title_disabled() returns a message if:
67 + *
68 + * - An SEO plugin is active.
69 + * - The theme does not support the 'title-tag' feature.
70 + * - The WPSSO_TITLE_TAG_DISABLE constant is true.
71 + */
72 + $doc_title_msg = $this->p->msgs->maybe_doc_title_disabled();
73 + $doc_title_disabled = $doc_title_msg ? true : false;
74 + $doc_title_source = $this->p->cf[ 'form' ][ 'document_title' ];
75 +
76 + $table_rows[] = '<td colspan="4">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
77 +
78 + $table_rows[ 'plugin_title_tag' ] = '' .
79 + $form->get_th_html( _x( 'Webpage Title Tag', 'option label', 'wpsso' ),
80 + $css_class = '', $css_id = 'plugin_title_tag' ) .
81 + '<td class="blank">' . $form->get_no_select( 'plugin_title_tag', $doc_title_source,
82 + $css_class = 'long_name', $css_id = '', $is_assoc = true ) .
83 + $doc_title_msg . '</td>' .
84 + WpssoAdmin::get_option_site_use( 'plugin_title_tag', $form, $args[ 'network' ] );
85 +
86 + $table_rows[ 'plugin_filter_content' ] = '' .
87 + $form->get_th_html( _x( 'Use Filtered Content', 'option label', 'wpsso' ),
88 + $css_class = '', $css_id = 'plugin_filter_content' ) .
89 + $form->get_no_td_checkbox( 'plugin_filter_content', _x( '(recommended after reading help text)', 'option comment', 'wpsso' ) ) .
90 + WpssoAdmin::get_option_site_use( 'plugin_filter_content', $form, $args[ 'network' ] );
91 +
92 + $table_rows[ 'plugin_filter_excerpt' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_filter_excerpt' ) .
93 + $form->get_th_html( _x( 'Use Filtered Excerpt', 'option label', 'wpsso' ),
94 + $css_class = '', $css_id = 'plugin_filter_excerpt' ) .
95 + $form->get_no_td_checkbox( 'plugin_filter_excerpt', _x( '(recommended - only if using shortcodes in excerpts)', 'option comment', 'wpsso' ) ) .
96 + WpssoAdmin::get_option_site_use( 'plugin_filter_excerpt', $form, $args[ 'network' ] );
97 +
98 + $table_rows[ 'plugin_page_excerpt' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_page_excerpt' ) .
99 + $form->get_th_html( _x( 'Enable Excerpt for Pages', 'option label', 'wpsso' ),
100 + $css_class = '', $css_id = 'plugin_page_excerpt' ) .
101 + $form->get_no_td_checkbox( 'plugin_page_excerpt' ) .
102 + WpssoAdmin::get_option_site_use( 'plugin_page_excerpt', $form, $args[ 'network' ] );
103 +
104 + $table_rows[ 'plugin_page_tags' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_page_tags' ) .
105 + $form->get_th_html( _x( 'Enable Tags for Pages', 'option label', 'wpsso' ),
106 + $css_class = '', $css_id = 'plugin_page_tags' ) .
107 + $form->get_no_td_checkbox( 'plugin_page_tags' ) .
108 + WpssoAdmin::get_option_site_use( 'plugin_page_tags', $form, $args[ 'network' ] );
109 +
110 + $table_rows[ 'plugin_new_user_is_person' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_new_user_is_person' ) .
111 + $form->get_th_html( _x( 'Add Person Role for New Users', 'option label', 'wpsso' ),
112 + $css_class = '', $css_id = 'plugin_new_user_is_person' ) .
113 + $form->get_no_td_checkbox( 'plugin_new_user_is_person' ) .
114 + WpssoAdmin::get_option_site_use( 'plugin_new_user_is_person', $form, $args[ 'network' ] );
115 +
116 + $table_rows[ 'plugin_inherit_featured' ] = '' .
117 + $form->get_th_html( _x( 'Inherit Featured Image', 'option label', 'wpsso' ),
118 + $css_class = '', $css_id = 'plugin_inherit_featured' ) .
119 + $form->get_no_td_checkbox( 'plugin_inherit_featured', _x( '(recommended)', 'option comment', 'wpsso' ) ) .
120 + WpssoAdmin::get_option_site_use( 'plugin_inherit_featured', $form, $args[ 'network' ] );
121 +
122 + $table_rows[ 'plugin_inherit_images' ] = '' .
123 + $form->get_th_html( _x( 'Inherit Custom Images', 'option label', 'wpsso' ),
124 + $css_class = '', $css_id = 'plugin_inherit_images' ) .
125 + $form->get_no_td_checkbox( 'plugin_inherit_images',
126 + _x( '(recommended)', 'option comment', 'wpsso' ) ) .
127 + WpssoAdmin::get_option_site_use( 'plugin_inherit_featured', $form, $args[ 'network' ] );
128 +
129 + $table_rows[ 'plugin_attached_images' ] = '' .
130 + $form->get_th_html( _x( 'Consider Attached Images', 'option label', 'wpsso' ),
131 + $css_class = '', $css_id = 'plugin_attached_images' ) .
132 + $form->get_no_td_checkbox( 'plugin_attached_images',
133 + _x( '(recommended for WooCommerce product gallery images)', 'option comment', 'wpsso' ) ) .
134 + WpssoAdmin::get_option_site_use( 'plugin_attached_images', $form, $args[ 'network' ] );
135 +
136 + $table_rows[ 'plugin_content_images' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_content_images' ) .
137 + $form->get_th_html( _x( 'Consider Content Images', 'option label', 'wpsso' ),
138 + $css_class = '', $css_id = 'plugin_content_images' ) .
139 + $form->get_no_td_checkbox( 'plugin_content_images' ) .
140 + WpssoAdmin::get_option_site_use( 'plugin_content_images', $form, $args[ 'network' ] );
141 +
142 + $table_rows[ 'plugin_check_img_dims' ] = '' .
143 + $form->get_th_html( _x( 'Image Dimension Checks', 'option label', 'wpsso' ),
144 + $css_class = '', $css_id = 'plugin_check_img_dims' ) .
145 + $form->get_no_td_checkbox( 'plugin_check_img_dims',
146 + _x( '(recommended)', 'option comment', 'wpsso' ) ) .
147 + WpssoAdmin::get_option_site_use( 'plugin_check_img_dims', $form, $args[ 'network' ] );
148 +
149 + $table_rows[ 'plugin_prevent_thumb_conflicts' ] = '' .
150 + $form->get_th_html( _x( 'Prevent Thumbnail Conflicts', 'option label', 'wpsso' ),
151 + $css_class = '', $css_id = 'plugin_prevent_thumb_conflicts' ) .
152 + $form->get_no_td_checkbox( 'plugin_prevent_thumb_conflicts',
153 + _x( '(recommended)', 'option comment', 'wpsso' ) ) .
154 + WpssoAdmin::get_option_site_use( 'plugin_prevent_thumb_conflicts', $form, $args[ 'network' ] );
155 +
156 + $table_rows[ 'plugin_upscale_images' ] = '' .
157 + $form->get_th_html( _x( 'Upscale Media Library Images', 'option label', 'wpsso' ),
158 + $css_class = '', $css_id = 'plugin_upscale_images' ) .
159 + $form->get_no_td_checkbox( 'plugin_upscale_images' ) .
160 + WpssoAdmin::get_option_site_use( 'plugin_upscale_images', $form, $args[ 'network' ] );
161 +
162 + $table_rows[ 'plugin_upscale_pct_max' ] = '' .
163 + $form->get_th_html( _x( 'Maximum Image Upscale Percent', 'option label', 'wpsso' ),
164 + $css_class = '', $css_id = 'plugin_upscale_pct_max' ) .
165 + '<td class="blank">' . $form->get_no_input( 'plugin_upscale_pct_max', $css_class = 'short' ) . ' %</td>' .
166 + WpssoAdmin::get_option_site_use( 'plugin_upscale_pct_max', $form, $args[ 'network' ] );
167 +
168 + /*
169 + * Plugin and theme integration options.
170 + */
171 + $table_rows[ 'subsection_plugin_theme_integration' ] = '' .
172 + '<td colspan="4" class="subsection"><h4>' . _x( 'Plugin and Theme Integration', 'metabox title', 'wpsso' ) . '</h4></td>';
173 +
174 + $table_rows[ 'plugin_speakable_css_csv' ] = '' .
175 + $form->get_th_html( _x( 'Speakable CSS Selectors', 'option label', 'wpsso' ),
176 + $css_class = '', $css_id = 'plugin_speakable_css_csv' ) .
177 + '<td class="blank">' . $form->get_no_input( 'plugin_speakable_css_csv', $css_class = 'wide' ) .
178 + WpssoAdmin::get_option_site_use( 'plugin_speakable_css_csv', $form, $args[ 'network' ] );
179 +
180 + $table_rows[ 'plugin_check_head' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_check_head' ) .
181 + $form->get_th_html( _x( 'Check for Duplicate Meta Tags', 'option label', 'wpsso' ),
182 + $css_class = '', $css_id = 'plugin_check_head' ) .
183 + $form->get_no_td_checkbox( 'plugin_check_head' ) .
184 + WpssoAdmin::get_option_site_use( 'plugin_check_head', $form, $args[ 'network' ] );
185 +
186 + $table_rows[ 'plugin_page_cache_active' ] = '' .
187 + $form->get_th_html( _x( 'Cache Plugin or Service is Active', 'option label', 'wpsso' ),
188 + $css_class = '', $css_id = 'plugin_page_cache_active' ) .
189 + $form->get_no_td_checkbox( 'plugin_page_cache_active' ) .
190 + WpssoAdmin::get_option_site_use( 'plugin_page_cache_active', $form, $args[ 'network' ] );
191 +
192 + $table_rows[ 'plugin_product_include_vat' ] = '' .
193 + $form->get_th_html( _x( 'Include VAT in Product Prices', 'option label', 'wpsso' ),
194 + $css_class = '', $css_id = 'plugin_product_include_vat' ) .
195 + $form->get_no_td_checkbox( 'plugin_product_include_vat' ) .
196 + WpssoAdmin::get_option_site_use( 'plugin_product_include_vat', $form, $args[ 'network' ] );
197 +
198 + $table_rows[ 'plugin_import_aioseop_meta' ] = '' .
199 + $form->get_th_html( _x( 'Import All in One SEO Pack Metadata', 'option label', 'wpsso' ),
200 + $css_class = '', $css_id = 'plugin_import_aioseop_meta' ) .
201 + $form->get_no_td_checkbox( 'plugin_import_aioseop_meta' ) .
202 + WpssoAdmin::get_option_site_use( 'plugin_import_aioseop_meta', $form, $args[ 'network' ] );
203 +
204 + $table_rows[ 'plugin_import_rankmath_meta' ] = '' .
205 + $form->get_th_html( _x( 'Import Rank Math SEO Metadata', 'option label', 'wpsso' ),
206 + $css_class = '', $css_id = 'plugin_import_rankmath_meta' ) .
207 + $form->get_no_td_checkbox( 'plugin_import_rankmath_meta' ) .
208 + WpssoAdmin::get_option_site_use( 'plugin_import_rankmath_meta', $form, $args[ 'network' ] );
209 +
210 + $table_rows[ 'plugin_import_seoframework_meta' ] = '' .
211 + $form->get_th_html( _x( 'Import The SEO Framework Metadata', 'option label', 'wpsso' ),
212 + $css_class = '', $css_id = 'plugin_import_seoframework_meta' ) .
213 + $form->get_no_td_checkbox( 'plugin_import_seoframework_meta' ) .
214 + WpssoAdmin::get_option_site_use( 'plugin_import_seoframework_meta', $form, $args[ 'network' ] );
215 +
216 + $table_rows[ 'plugin_import_wpmetaseo_meta' ] = '' .
217 + $form->get_th_html( _x( 'Import WP Meta SEO Metadata', 'option label', 'wpsso' ),
218 + $css_class = '', $css_id = 'plugin_import_wpmetaseo_meta' ) .
219 + $form->get_no_td_checkbox( 'plugin_import_wpmetaseo_meta' ) .
220 + WpssoAdmin::get_option_site_use( 'plugin_import_wpmetaseo_meta', $form, $args[ 'network' ] );
221 +
222 + $table_rows[ 'plugin_import_wpseo_meta' ] = '' .
223 + $form->get_th_html( _x( 'Import Yoast SEO Metadata', 'option label', 'wpsso' ),
224 + $css_class = '', $css_id = 'plugin_import_wpseo_meta' ) .
225 + $form->get_no_td_checkbox( 'plugin_import_wpseo_meta' ) .
226 + WpssoAdmin::get_option_site_use( 'plugin_import_wpseo_meta', $form, $args[ 'network' ] );
227 +
228 + $table_rows[ 'plugin_import_wpseo_blocks' ] = '' .
229 + $form->get_th_html( _x( 'Import Yoast SEO Block Attrs', 'option label', 'wpsso' ),
230 + $css_class = '', $css_id = 'plugin_import_wpseo_blocks' ) .
231 + $form->get_no_td_checkbox( 'plugin_import_wpseo_blocks' ) .
232 + WpssoAdmin::get_option_site_use( 'plugin_import_wpseo_blocks', $form, $args[ 'network' ] );
233 +
234 + return $table_rows;
235 + }
236 +
237 + /*
238 + * Plugin Settings > Default Text tab.
239 + */
240 + public function filter_mb_advanced_plugin_default_text_rows( $table_rows, $form, $args ) {
241 +
242 + /*
243 + * WpssoMessages->maybe_doc_title_disabled() returns a message if:
244 + *
245 + * - An SEO plugin is active.
246 + * - The theme does not support the 'title-tag' feature.
247 + * - The WPSSO_TITLE_TAG_DISABLE constant is true.
248 + */
249 + $doc_title_msg = $this->p->msgs->maybe_doc_title_disabled();
250 + $doc_title_disabled = $doc_title_msg ? true : false;
251 +
252 + $table_rows[] = '<td colspan="4">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
253 +
254 + $table_rows[ 'plugin_title_part_site' ] = '' .
255 + $form->get_th_html_locale( _x( 'Title Tag Site Suffix', 'option label', 'wpsso' ),
256 + $css_class = '', $css_id = 'plugin_title_part_site' ) .
257 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_title_part_site', $css_class = 'long_name' ) .
258 + $doc_title_msg . '</td>';
259 +
260 + $table_rows[ 'plugin_title_part_tagline' ] = '' .
261 + $form->get_th_html_locale( _x( 'Title Tag Tagline Suffix', 'option label', 'wpsso' ),
262 + $css_class = '', $css_id = 'plugin_title_part_tagline' ) .
263 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_title_part_tagline', $css_class = 'wide' ) . '</td>';
264 +
265 + $table_rows[ 'plugin_img_alt_prefix' ] = '' .
266 + $form->get_th_html_locale( _x( 'Content Image Alt Prefix', 'option label', 'wpsso' ),
267 + $css_class = '', $css_id = 'plugin_img_alt_prefix' ) .
268 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_img_alt_prefix' ) . '</td>';
269 +
270 + $table_rows[ 'plugin_p_cap_prefix' ] = '' .
271 + $form->get_th_html_locale( _x( 'WP Caption Text Prefix', 'option label', 'wpsso' ),
272 + $css_class = '', $css_id = 'plugin_p_cap_prefix' ) .
273 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_p_cap_prefix' ) . '</td>';
274 +
275 + $table_rows[ 'plugin_comment_title' ] = '' .
276 + $form->get_th_html_locale( _x( 'Comment Title', 'option label', 'wpsso' ),
277 + $css_class = '', $css_id = 'plugin_comment_title' ) .
278 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_comment_title', $css_class = 'wide' ) . '</td>';
279 +
280 + $table_rows[ 'plugin_comment_reply_title' ] = '' .
281 + $form->get_th_html_locale( _x( 'Reply Comment Title', 'option label', 'wpsso' ),
282 + $css_class = '', $css_id = 'plugin_comment_reply_title' ) .
283 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_comment_reply_title', $css_class = 'wide' ) . '</td>';
284 +
285 + $table_rows[ 'plugin_comment_review_title' ] = '' .
286 + $form->get_th_html_locale( _x( 'Review Comment Title', 'option label', 'wpsso' ),
287 + $css_class = '', $css_id = 'plugin_comment_review_title' ) .
288 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_comment_review_title', $css_class = 'wide' ) . '</td>';
289 +
290 + $table_rows[ 'plugin_product_var_title' ] = '' .
291 + $form->get_th_html_locale( _x( 'Product Variation Title', 'option label', 'wpsso' ),
292 + $css_class = '', $css_id = 'plugin_product_var_title' ) .
293 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_product_var_title', $css_class = 'wide' ) . '</td>';
294 +
295 + $table_rows[ 'plugin_feed_title' ] = '' .
296 + $form->get_th_html_locale( _x( 'RSS Feed Title', 'option label', 'wpsso' ),
297 + $css_class = '', $css_id = 'plugin_feed_title' ) .
298 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_feed_title', $css_class = 'wide' ) . '</td>';
299 +
300 + $table_rows[ 'plugin_404_page_title' ] = '' .
301 + $form->get_th_html_locale( _x( '404 Page Title', 'option label', 'wpsso' ),
302 + $css_class = '', $css_id = 'plugin_404_page_title' ) .
303 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_404_page_title', $css_class = 'wide' ) . '</td>';
304 +
305 + $table_rows[ 'plugin_404_page_desc' ] = '' .
306 + $form->get_th_html_locale( _x( '404 Page Description', 'option label', 'wpsso' ),
307 + $css_class = '', $css_id = 'plugin_404_page_desc' ) .
308 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_404_page_desc', $css_class = 'wide' ) . '</td>';
309 +
310 + $table_rows[ 'plugin_no_title_text' ] = '' .
311 + $form->get_th_html_locale( _x( 'No Title Text', 'option label', 'wpsso' ),
312 + $css_class = '', $css_id = 'plugin_no_title_text' ) .
313 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_no_title_text', $css_class = 'wide' ) . '</td>';
314 +
315 + $table_rows[ 'plugin_no_desc_text' ] = '' .
316 + $form->get_th_html_locale( _x( 'No Description Text', 'option label', 'wpsso' ),
317 + $css_class = '', $css_id = 'plugin_no_desc_text' ) .
318 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_no_desc_text', $css_class = 'wide' ) . '</td>';
319 +
320 + $table_rows[ 'subsection_archive_pages' ] = '' .
321 + '<td colspan="2" class="subsection"><h4>' . _x( 'Archive Pages', 'metabox title', 'wpsso' ) . '</h4></td>';
322 +
323 + $table_rows[ 'plugin_term_page_title' ] = '' .
324 + $form->get_th_html_locale( _x( 'Term Archive Title', 'option label', 'wpsso' ),
325 + $css_class = '', $css_id = 'plugin_term_page_title' ) .
326 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_term_page_title', $css_class = 'wide' ) . '</td>';
327 +
328 + $table_rows[ 'plugin_term_page_desc' ] = '' .
329 + $form->get_th_html_locale( _x( 'Term Archive Description', 'option label', 'wpsso' ),
330 + $css_class = '', $css_id = 'plugin_term_page_desc' ) .
331 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_term_page_desc', $css_class = 'wide' ) . '</td>';
332 +
333 + $table_rows[ 'plugin_author_page_title' ] = '' .
334 + $form->get_th_html_locale( _x( 'Author Archive Title', 'option label', 'wpsso' ),
335 + $css_class = '', $css_id = 'plugin_author_page_title' ) .
336 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_author_page_title', $css_class = 'wide' ) . '</td>';
337 +
338 + $table_rows[ 'plugin_author_page_desc' ] = '' .
339 + $form->get_th_html_locale( _x( 'Author Archive Description', 'option label', 'wpsso' ),
340 + $css_class = '', $css_id = 'plugin_author_page_desc' ) .
341 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_author_page_desc', $css_class = 'wide' ) . '</td>';
342 +
343 + $table_rows[ 'plugin_search_page_title' ] = '' .
344 + $form->get_th_html_locale( _x( 'Search Results Title', 'option label', 'wpsso' ),
345 + $css_class = '', $css_id = 'plugin_search_page_title' ) .
346 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_search_page_title', $css_class = 'wide' ) . '</td>';
347 +
348 + $table_rows[ 'plugin_search_page_desc' ] = '' .
349 + $form->get_th_html_locale( _x( 'Search Results Description', 'option label', 'wpsso' ),
350 + $css_class = '', $css_id = 'plugin_search_page_desc' ) .
351 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_search_page_desc', $css_class = 'wide' ) . '</td>';
352 +
353 + $table_rows[ 'plugin_year_page_title' ] = '' .
354 + $form->get_th_html_locale( _x( 'Year Archive Title', 'option label', 'wpsso' ),
355 + $css_class = '', $css_id = 'plugin_year_page_title' ) .
356 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_year_page_title', $css_class = 'wide' ) . '</td>';
357 +
358 + $table_rows[ 'plugin_year_page_desc' ] = '' .
359 + $form->get_th_html_locale( _x( 'Year Archive Description', 'option label', 'wpsso' ),
360 + $css_class = '', $css_id = 'plugin_year_page_desc' ) .
361 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_year_page_desc', $css_class = 'wide' ) . '</td>';
362 +
363 + $table_rows[ 'plugin_month_page_title' ] = '' .
364 + $form->get_th_html_locale( _x( 'Month Archive Title', 'option label', 'wpsso' ),
365 + $css_class = '', $css_id = 'plugin_month_page_title' ) .
366 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_month_page_title', $css_class = 'wide' ) . '</td>';
367 +
368 + $table_rows[ 'plugin_month_page_desc' ] = '' .
369 + $form->get_th_html_locale( _x( 'Month Archive Description', 'option label', 'wpsso' ),
370 + $css_class = '', $css_id = 'plugin_month_page_desc' ) .
371 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_month_page_desc', $css_class = 'wide' ) . '</td>';
372 +
373 + $table_rows[ 'plugin_day_page_title' ] = '' .
374 + $form->get_th_html_locale( _x( 'Day Archive Title', 'option label', 'wpsso' ),
375 + $css_class = '', $css_id = 'plugin_day_page_title' ) .
376 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_day_page_title', $css_class = 'wide' ) . '</td>';
377 +
378 + $table_rows[ 'plugin_day_page_desc' ] = '' .
379 + $form->get_th_html_locale( _x( 'Day Archive Description', 'option label', 'wpsso' ),
380 + $css_class = '', $css_id = 'plugin_day_page_desc' ) .
381 + '<td class="blank">' . $form->get_no_input_locale( 'plugin_day_page_desc', $css_class = 'wide' ) . '</td>';
382 +
383 + $post_type_archives = SucomUtilWP::get_post_type_archives( $output = 'objects', $sort = true );
384 +
385 + if ( ! empty( $post_type_archives ) ) {
386 +
387 + $table_rows[ 'subsection_post_type_archive_pages' ] = '' .
388 + '<td colspan="2" class="subsection"><h4>' . _x( 'Post Type Archive Pages', 'metabox title', 'wpsso' ) . '</h4></td>';
389 +
390 + foreach ( $post_type_archives as $num => $post_type_obj ) {
391 +
392 + if ( ! is_object( $post_type_obj ) ) continue; // Just in case.
393 +
394 + $obj_label = sprintf( _x( '%s Archive Page', 'metabox title', 'wpsso' ), SucomUtilWP::get_object_label( $post_type_obj ) );
395 + $title_key = 'plugin_pta_' . $post_type_obj->name . '_title';
396 + $desc_key = 'plugin_pta_' . $post_type_obj->name . '_desc';
397 +
398 + $table_rows[ 'subsection_pta_' . $post_type_obj->name ] = '' .
399 + '<td colspan="2" class="subsection' . ( $num ? '' : ' top' ) . '"><h5>' . $obj_label . '</h4></td>';
400 +
401 + $def_title_text = empty( $post_type_obj->label ) ?
402 + $this->p->opt->get_text( 'plugin_no_title_text' ) : $post_type_obj->label;
403 +
404 + $def_desc_text = empty( $post_type_obj->description ) ? // The post type object may not have a description.
405 + $this->p->opt->get_text( 'plugin_no_desc_text' ) : $post_type_obj->description;
406 +
407 + $table_rows[ $title_key ] = '' .
408 + $form->get_th_html_locale( _x( 'Archive Page Title', 'option label', 'wpsso' ), $css_class = '', $title_key ) .
409 + '<td class="blank">' . $form->get_no_input_locale( $title_key, $css_class = 'wide', $css_id = '',
410 + $def_title_text ) . '</td>';
411 +
412 + $table_rows[ $desc_key ] = '' .
413 + $form->get_th_html_locale( _x( 'Archive Page Description', 'option label', 'wpsso' ), $css_class = '', $desc_key ) .
414 + '<td class="blank">' . $form->get_no_textarea_locale( $desc_key, $css_class = '', $css_id = '',
415 + $len = 0, $def_desc_text ) . '</td>';
416 + }
417 + }
418 +
419 + return $table_rows;
420 + }
421 +
422 + /*
423 + * SSO > Advanced Settings > Plugin Settings > Image Sizes tab.
424 + */
425 + public function filter_mb_advanced_plugin_image_sizes_rows( $table_rows, $form, $args ) {
426 +
427 + $pin_img_disabled = $this->p->util->is_pin_img_disabled();
428 + $pin_img_msg = $this->p->msgs->maybe_pin_img_disabled( $extra_css_class = 'inline' );
429 +
430 + if ( $info_msg = $this->p->msgs->get( 'info-image_dimensions' ) ) {
431 +
432 + $table_rows[ 'info-image_dimensions' ] = '<td colspan="2">' . $info_msg . '</td>';
433 + }
434 +
435 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
436 +
437 + $table_rows[ 'og_img_size' ] = '' .
438 + $form->get_th_html( _x( 'Open Graph (Facebook and oEmbed)', 'option label', 'wpsso' ),
439 + $css_class = '', $css_id = 'og_img_size' ) .
440 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'og_img' ) . '</td>';
441 +
442 + $table_rows[ 'pin_img_size' ] = ( $pin_img_disabled ? $form->get_tr_hide( $in_view = 'basic' ) : '' ) .
443 + $form->get_th_html( _x( 'Pinterest Pin It', 'option label', 'wpsso' ),
444 + $css_class = '', $css_id = 'pin_img_size' ) .
445 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'pin_img', $pin_img_disabled ) . $pin_img_msg . '</td>';
446 +
447 + $table_rows[ 'schema_01_01_img_size' ] = '' .
448 + $form->get_th_html( _x( 'Schema 1:1 (Google Rich Results)', 'option label', 'wpsso' ),
449 + $css_class = '', $css_id = 'schema_1x1_img_size' ) .
450 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'schema_1x1_img' ) . '</td>';
451 +
452 + if ( apply_filters( 'wpsso_add_image_sizes_schema_4x3', true ) ) {
453 +
454 + $table_rows[ 'schema_04_03_img_size' ] = '' .
455 + $form->get_th_html( _x( 'Schema 4:3 (Google Rich Results)', 'option label', 'wpsso' ),
456 + $css_class = '', $css_id = 'schema_4x3_img_size' ) .
457 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'schema_4x3_img' ) . '</td>';
458 + }
459 +
460 + if ( apply_filters( 'wpsso_add_image_sizes_schema_16x9', true ) ) {
461 +
462 + $table_rows[ 'schema_16_09_img_size' ] = '' .
463 + $form->get_th_html( _x( 'Schema 16:9 (Google Rich Results)', 'option label', 'wpsso' ),
464 + $css_class = '', $css_id = 'schema_16x9_img_size' ) .
465 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'schema_16x9_img' ) . '</td>';
466 + }
467 +
468 + if ( apply_filters( 'wpsso_add_image_sizes_schema_thumb', true ) ) {
469 +
470 + $table_rows[ 'schema_thumb_img_size' ] = '' .
471 + $form->get_th_html( _x( 'Schema Thumbnail', 'option label', 'wpsso' ),
472 + $css_class = '', $css_id = 'schema_thumb_img_size' ) .
473 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'thumb_img' ) . '</td>';
474 + }
475 +
476 + $table_rows[ 'tc_00_sum_img_size' ] = '' .
477 + $form->get_th_html( _x( 'X (Twitter) Summary Card', 'option label', 'wpsso' ),
478 + $css_class = '', $css_id = 'tc_sum_img_size' ) .
479 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'tc_sum_img' ) . '</td>';
480 +
481 + $table_rows[ 'tc_01_lrg_img_size' ] = '' .
482 + $form->get_th_html( _x( 'X (Twitter) Summary Card Large Image', 'option label', 'wpsso' ),
483 + $css_class = '', $css_id = 'tc_lrg_img_size' ) .
484 + '<td class="blank">' . $form->get_no_input_image_dimensions( 'tc_lrg_img' ) . '</td>';
485 +
486 + return $table_rows;
487 + }
488 +
489 + /*
490 + * Plugin Settings > Interface tab.
491 + */
492 + public function filter_mb_advanced_plugin_interface_rows( $table_rows, $form, $args ) {
493 +
494 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
495 +
496 + $table_rows[ 'plugin_show_opts' ] = '' .
497 + $form->get_th_html( _x( 'Show Options by Default', 'option label', 'wpsso' ),
498 + $css_class = 'medium', $css_id = 'plugin_show_opts' ) .
499 + '<td class="blank">' . $form->get_no_select( 'plugin_show_opts', $this->p->cf[ 'form' ][ 'show_options' ] ) . '</td>';
500 +
501 + $table_rows[ 'plugin_og_types_select_format' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_og_types_select_format' ) .
502 + $form->get_th_html( _x( 'Open Graph Select', 'option label', 'wpsso' ),
503 + $css_class = 'medium', $css_id = 'plugin_og_types_select_format' ) .
504 + '<td class="blank">' . $form->get_no_select( 'plugin_og_types_select_format',
505 + $this->p->cf[ 'form' ][ 'og_schema_types_select_format' ] ) . '</td>';
506 +
507 + $table_rows[ 'plugin_schema_types_select_format' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_schema_types_select_format' ) .
508 + $form->get_th_html( _x( 'Schema Type Select', 'option label', 'wpsso' ),
509 + $css_class = 'medium', $css_id = 'plugin_schema_types_select_format' ) .
510 + '<td class="blank">' . $form->get_no_select( 'plugin_schema_types_select_format',
511 + $this->p->cf[ 'form' ][ 'og_schema_types_select_format' ] ) . '</td>';
512 +
513 + /*
514 + * Show validators toolbar menu.
515 + */
516 + $menu_title = _x( 'Validators', 'toolbar menu title', 'wpsso' );
517 +
518 + $table_rows[ 'plugin_add_toolbar_validate' ] = '' .
519 + $form->get_th_html( sprintf( _x( 'Show %s Toolbar', 'option label', 'wpsso' ), $menu_title ), // Show Validators Toolbar.
520 + $css_class = 'medium', $css_id = 'plugin_add_toolbar_validate' ) .
521 + $form->get_no_td_checkbox( 'plugin_add_toolbar_validate' );
522 +
523 + /*
524 + * Show SSO menu items.
525 + */
526 + $menu_title = $this->p->admin->get_menu_title();
527 + $menu_args = $this->p->admin->get_submenu_args( $menu_lib = 'submenu' );
528 +
529 + foreach ( $menu_args as $menu_id => $args ) {
530 +
531 + if ( ! isset( $form->defaults[ 'plugin_add_submenu_' . $menu_id ] ) ) // Just in case.
532 + $form->defaults[ 'plugin_add_submenu_' . $menu_id ] = 1;
533 +
534 + if ( ! isset( $form->options[ 'plugin_add_submenu_' . $menu_id ] ) ) // Just in case.
535 + $form->options[ 'plugin_add_submenu_' . $menu_id ] = 1;
536 +
537 + if ( empty( $this->p->cf[ 'menu' ][ 'must_load' ][ $menu_id ] ) ) // Exclude must-load menu items.
538 + $values[ $menu_id ] = $args[ 2 ];
539 + }
540 +
541 + $table_rows[ 'plugin_add_submenu' ] = $form->get_tr_hide_prefix( $in_view = 'basic', 'plugin_add_submenu_' ) .
542 + $form->get_th_html( sprintf( _x( 'Show %s Menu Items', 'option label', 'wpsso' ), $menu_title ),
543 + $css_class = 'medium', $css_id = 'plugin_add_submenu' ) .
544 + '<td class="blank">' . $form->get_no_checklist( $name_prefix = 'plugin_add_submenu', $values ) . '</td>';
545 +
546 + /*
547 + * Show custom meta metaboxes.
548 + */
549 + $metabox_title = _x( $this->p->cf[ 'meta' ][ 'title' ], 'metabox title', 'wpsso' );
550 +
551 + $table_rows[ 'plugin_add_to' ] = $form->get_tr_hide_prefix( $in_view = 'basic', 'plugin_add_to_' ) .
552 + $form->get_th_html( sprintf( _x( 'Show %s Metabox', 'option label', 'wpsso' ), $metabox_title ),
553 + $css_class = 'medium', $css_id = 'plugin_add_to' ) .
554 + '<td class="blank">' . $form->get_no_checklist_post_tax_user( $name_prefix = 'plugin_add_to' ) . '</td>';
555 +
556 + /*
557 + * Additional item list columns.
558 + */
559 + $col_headers = WpssoAbstractWpMeta::get_column_headers();
560 +
561 + $table_rows[ 'plugin_show_columns' ] = '' .
562 + $form->get_th_html( _x( 'WP List Table Columns', 'option label', 'wpsso' ),
563 + $css_class = 'medium', $css_id = 'plugin_show_columns' ) .
564 + '<td>' . $form->get_no_columns_post_tax_user( $name_prefix = 'plugin',
565 + $col_headers, $table_class = 'plugin_list_table_cols' ) . '</td>';
566 +
567 + return $table_rows;
568 + }
569 +
570 + /*
571 + * Service APIs > Media Services tab.
572 + */
573 + public function filter_mb_advanced_services_media_rows( $table_rows, $form, $args ) {
574 +
575 + if ( $this->p->debug->enabled ) {
576 +
577 + $this->p->debug->mark();
578 + }
579 +
580 + $max_media_items = $this->p->cf[ 'form' ][ 'max_media_items' ];
581 +
582 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
583 +
584 + $table_rows[ 'plugin_gravatar_image' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_gravatar_image' ) .
585 + $form->get_th_html( _x( 'Gravatar is Default Author Image', 'option label', 'wpsso' ),
586 + $css_class = '', $css_id = 'plugin_gravatar_image' ) .
587 + $form->get_no_td_checkbox( 'plugin_gravatar_image' );
588 +
589 + $table_rows[ 'plugin_gravatar_size' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_gravatar_size' ) .
590 + $form->get_th_html( _x( 'Gravatar Image Size', 'option label', 'wpsso' ),
591 + $css_class = '', $css_id = 'plugin_gravatar_size' ) .
592 + '<td class="blank">' . $form->get_no_input( 'plugin_gravatar_size', $css_class = 'short' ) . '</td>';
593 +
594 + $table_rows[ 'og_vid_max' ] = $form->get_tr_hide( $in_view = 'basic', 'og_vid_max' ) .
595 + $form->get_th_html( _x( 'Maximum Videos to Include', 'option label', 'wpsso' ),
596 + $css_class = '', $css_id = 'og_vid_max' ) .
597 + '<td class="blank">' . $form->get_no_select( 'og_vid_max', range( 0, $max_media_items ),
598 + $css_class = 'short', $css_id = '', $is_assoc = true ) . '</td>';
599 +
600 + $table_rows[ 'og_vid_prev_img' ] = '' .
601 + $form->get_th_html( _x( 'Include Video Preview Images', 'option label', 'wpsso' ),
602 + $css_class = '', $css_id = 'og_vid_prev_img' ) .
603 + $form->get_no_td_checkbox( 'og_vid_prev_img', $this->p->msgs->preview_images_are_first() );
604 +
605 + $table_rows[ 'og_vid_autoplay' ] = $form->get_tr_hide( $in_view = 'basic', 'og_vid_autoplay' ) .
606 + $form->get_th_html( _x( 'Force Autoplay when Possible', 'option label', 'wpsso' ),
607 + $css_class = '', $css_id = 'og_vid_autoplay' ) .
608 + $form->get_no_td_checkbox( 'og_vid_autoplay' );
609 +
610 + $check_embed_html = '';
611 +
612 + foreach ( $this->p->cf[ 'form' ][ 'embed_media' ] as $opt_key => $opt_label ) {
613 +
614 + $check_embed_html .= '<p>' . $form->get_no_checkbox_comment( $opt_key ) . ' ' . _x( $opt_label, 'option value', 'wpsso' ) . '</p>';
615 + }
616 +
617 + $table_rows[ 'plugin_embed_media' ] = '' .
618 + $form->get_th_html( _x( 'Detect Embedded Media', 'option label', 'wpsso' ),
619 + $css_class = '', $css_id = 'plugin_embed_media' ).
620 + '<td class="blank">' . $check_embed_html . '</td>';
621 +
622 + return $table_rows;
623 + }
624 +
625 + /*
626 + * Service APIs > Shortening Services tab.
627 + */
628 + public function filter_mb_advanced_services_shortening_rows( $table_rows, $form, $args ) {
629 +
630 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
631 +
632 + $table_rows[ 'plugin_shortener' ] = '' .
633 + $form->get_th_html( _x( 'URL Shortening Service', 'option label', 'wpsso' ),
634 + $css_class = '', $css_id = 'plugin_shortener' ) .
635 + '<td class="blank">' . $form->get_no_select_none( 'plugin_shortener' ) . '</td>';
636 +
637 + $table_rows[ 'plugin_min_shorten' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_min_shorten' ) .
638 + $form->get_th_html( _x( 'Minimum URL Length to Shorten', 'option label', 'wpsso' ),
639 + $css_class = '', $css_id = 'plugin_min_shorten' ) .
640 + '<td class="blank">' . $form->get_no_input( 'plugin_min_shorten', $css_class = 'short' ) . ' ' .
641 + _x( 'characters', 'option comment', 'wpsso' ) . '</td>';
642 +
643 + $table_rows[ 'plugin_wp_shortlink' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_wp_shortlink' ) .
644 + $form->get_th_html( _x( 'Use Short URL for WP Shortlink', 'option label', 'wpsso' ),
645 + $css_class = '', $css_id = 'plugin_wp_shortlink' ) .
646 + $form->get_no_td_checkbox( 'plugin_wp_shortlink' );
647 +
648 + $table_rows[ 'plugin_add_link_rel_shortlink' ] = $form->get_tr_hide( $in_view = 'basic', 'add_link_rel_shortlink' ) .
649 + $form->get_th_html( sprintf( _x( 'Add "%s" HTML Tag', 'option label', 'wpsso' ), 'link&nbsp;rel&nbsp;shortlink' ),
650 + $css_class = '', $css_id = 'plugin_add_link_rel_shortlink' ) .
651 + '<td class="blank">' . $form->get_no_checkbox( 'add_link_rel_shortlink', $css_class = '', $css_id = 'add_link_rel_shortlink_html_tag',
652 + $force = null, $group = 'add_link_rel_shortlink' ) . '</td>'; // Group with option in head tags list
653 +
654 + return $table_rows;
655 + }
656 +
657 + /*
658 + * Service APIs > Ratings and Reviews tab.
659 + */
660 + public function filter_mb_advanced_services_ratings_reviews_rows( $table_rows, $form, $args ) {
661 +
662 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
663 +
664 + $ratings_reviews = $this->p->cf[ 'form' ][ 'ratings_reviews' ];
665 +
666 + $table_rows[ 'plugin_ratings_reviews_svc' ] = '' .
667 + $form->get_th_html( _x( 'Ratings and Reviews Service', 'option label', 'wpsso' ),
668 + $css_class = '', $css_id = 'plugin_ratings_reviews_svc' ) .
669 + '<td class="blank">' . $form->get_no_select_none( 'plugin_ratings_reviews_svc' ) . '</td>';
670 +
671 + $table_rows[ 'plugin_ratings_reviews_num_max' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_ratings_reviews_num_max' ) .
672 + $form->get_th_html( _x( 'Maximum Number of Reviews', 'option label', 'wpsso' ),
673 + $css_class = '', $css_id = 'plugin_ratings_reviews_num_max' ) .
674 + '<td class="blank">' . $form->get_no_input( 'plugin_ratings_reviews_num_max', $css_class = 'short' ) . '</td>';
675 +
676 + $table_rows[ 'plugin_ratings_reviews_months_max' ] = $form->get_tr_hide( $in_view = 'basic', 'plugin_ratings_reviews_months_max' ) .
677 + $form->get_th_html( _x( 'Maximum Age of Reviews', 'option label', 'wpsso' ),
678 + $css_class = '', $css_id = 'plugin_ratings_reviews_months_max' ) .
679 + '<td class="blank">' . $form->get_no_input( 'plugin_ratings_reviews_months_max', $css_class = 'short' ) . ' ' .
680 + _x( 'months', 'option comment', 'wpsso' ) . '</td>';
681 +
682 + $table_rows[ 'plugin_ratings_reviews_for' ] = '' .
683 + $form->get_th_html( _x( 'Get Reviews for Post Types', 'option label', 'wpsso' ),
684 + $css_class = '', $css_id = 'plugin_ratings_reviews_for' ) .
685 + '<td class="blank">' . $form->get_no_checklist_post_types( $name_prefix = 'plugin_ratings_reviews_for' ) . '</td>';
686 +
687 + return $table_rows;
688 + }
689 +
690 + /*
691 + * Document Types > Open Graph tab.
692 + */
693 + public function filter_mb_advanced_doc_types_og_types_rows( $table_rows, $form, $args ) {
694 +
695 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
696 +
697 + /*
698 + * Open Graph Type.
699 + */
700 + foreach ( array(
701 + 'og_type_for_home_page' => _x( 'Type for Page Homepage', 'option label', 'wpsso' ),
702 + 'og_type_for_home_posts' => _x( 'Type for Posts Homepage', 'option label', 'wpsso' ),
703 + 'og_type_for_user_page' => _x( 'Type for User Profiles', 'option label', 'wpsso' ),
704 + 'og_type_for_search_page' => _x( 'Type for Search Results', 'option label', 'wpsso' ),
705 + 'og_type_for_archive_page' => _x( 'Type for Archive Page', 'option label', 'wpsso' ),
706 + ) as $opt_key => $th_label ) {
707 +
708 + $table_rows[ $opt_key ] = $form->get_tr_hide( $in_view = 'basic', $opt_key ) .
709 + $form->get_th_html( $th_label, $css_class = '', $opt_key ) .
710 + '<td class="blank">' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'og_types' ],
711 + $css_class = 'og_type' ) . '</td>';
712 + }
713 +
714 + /*
715 + * Open Graph Type by Post Type.
716 + *
717 + * SucomUtilWP::get_post_type_labels() calls SucomUtilWP::get_post_types(), which returns post types
718 + * registered as 'public' = true and 'show_ui' = true by default. Note that the 'wp_block' custom post type
719 + * for reusable blocks is registered as 'public' = false and 'show_ui' = true.
720 + */
721 + $type_select = '';
722 + $type_labels = SucomUtilWP::get_post_type_labels( $val_prefix = 'og_type_for_' );
723 +
724 + foreach ( $type_labels as $opt_key => $obj_label ) {
725 +
726 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'og_types' ],
727 + $css_class = 'og_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
728 + $obj_label ) . '</p>' . "\n";
729 + }
730 +
731 + $table_rows[ 'og_type_for_pt' ] = '' .
732 + $form->get_th_html( _x( 'Type by Post Type', 'option label', 'wpsso' ),
733 + $css_class = '', $css_id = 'og_type_for_pt' ) .
734 + '<td class="blank">' . $type_select . '</td>';
735 +
736 + /*
737 + * Open Graph Type by Post Type Archive.
738 + */
739 + $type_select = '';
740 + $type_keys = array();
741 + $type_labels = SucomUtilWP::get_post_type_archive_labels( $val_prefix = 'og_type_for_pta_' );
742 +
743 + foreach ( $type_labels as $opt_key => $obj_label ) {
744 +
745 + $type_keys[] = $opt_key;
746 +
747 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'og_types' ],
748 + $css_class = 'og_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
749 + $obj_label ) . '</p>' . "\n";
750 + }
751 +
752 + if ( ! empty( $type_select ) ) {
753 +
754 + $table_rows[ 'og_type_for_pta' ] = $form->get_tr_hide( $in_view = 'basic', $type_keys ) .
755 + $form->get_th_html( _x( 'Type by Post Type Archive', 'option label', 'wpsso' ),
756 + $css_class = '', $css_id = 'og_type_for_pta' ) .
757 + '<td class="blank">' . $type_select . '</td>';
758 + }
759 +
760 + /*
761 + * Open Graph Type by Taxonomy.
762 + */
763 + $type_select = '';
764 + $type_keys = array();
765 + $type_labels = SucomUtilWP::get_taxonomy_labels( $val_prefix = 'og_type_for_tax_' );
766 +
767 + foreach ( $type_labels as $opt_key => $obj_label ) {
768 +
769 + $type_keys[] = $opt_key;
770 +
771 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'og_types' ],
772 + $css_class = 'og_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
773 + $obj_label ) . '</p>' . "\n";
774 + }
775 +
776 + $table_rows[ 'og_type_for_tax' ] = $form->get_tr_hide( $in_view = 'basic', $type_keys ) .
777 + $form->get_th_html( _x( 'Type by Taxonomy', 'option label', 'wpsso' ), $css_class = '', $css_id = 'og_type_for_tax' ) .
778 + '<td class="blank">' . $type_select . '</td>';
779 +
780 + return $table_rows;
781 + }
782 +
783 + /*
784 + * Document Types > Schema tab.
785 + */
786 + public function filter_mb_advanced_doc_types_schema_types_rows( $table_rows, $form, $args ) {
787 +
788 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
789 +
790 + /*
791 + * Schema Type.
792 + */
793 + foreach ( array(
794 + 'schema_type_for_home_page' => _x( 'Type for Page Homepage', 'option label', 'wpsso' ),
795 + 'schema_type_for_home_posts' => _x( 'Type for Posts Homepage', 'option label', 'wpsso' ),
796 + 'schema_type_for_user_page' => _x( 'Type for User Profiles', 'option label', 'wpsso' ),
797 + 'schema_type_for_search_page' => _x( 'Type for Search Results', 'option label', 'wpsso' ),
798 + 'schema_type_for_archive_page' => _x( 'Type for Archive Page', 'option label', 'wpsso' ),
799 + ) as $opt_key => $th_label ) {
800 +
801 + $table_rows[ $opt_key ] = $form->get_tr_hide( $in_view = 'basic', $opt_key ) .
802 + $form->get_th_html( $th_label, $css_class = '', $opt_key ) .
803 + '<td class="blank">' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'schema_types' ],
804 + $css_class = 'schema_type' ) . '</td>';
805 + }
806 +
807 + /*
808 + * Schema Type by Post Type.
809 + *
810 + * SucomUtilWP::get_post_type_labels() calls SucomUtilWP::get_post_types(), which returns post types
811 + * registered as 'public' = true and 'show_ui' = true by default. Note that the 'wp_block' custom post type
812 + * for reusable blocks is registered as 'public' = false and 'show_ui' = true.
813 + */
814 + $type_select = '';
815 + $type_labels = SucomUtilWP::get_post_type_labels( $val_prefix = 'schema_type_for_' );
816 + $type_labels = apply_filters( 'wpsso_schema_type_post_type_labels', $type_labels );
817 +
818 + foreach ( $type_labels as $opt_key => $obj_label ) {
819 +
820 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'schema_types' ],
821 + $css_class = 'schema_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
822 + $obj_label ) . '</p>' . "\n";
823 + }
824 +
825 + $table_rows[ 'schema_type_for_pt' ] = '' .
826 + $form->get_th_html( _x( 'Type by Post Type', 'option label', 'wpsso' ),
827 + $css_class = '', $css_id = 'schema_type_for_pt' ) .
828 + '<td class="blank">' . $type_select . '</td>';
829 +
830 + /*
831 + * Schema Type by Post Type Archive.
832 + */
833 + $type_select = '';
834 + $type_keys = array();
835 + $type_labels = SucomUtilWP::get_post_type_archive_labels( $val_prefix = 'schema_type_for_pta_' );
836 +
837 + foreach ( $type_labels as $opt_key => $obj_label ) {
838 +
839 + $type_keys[] = $opt_key;
840 +
841 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'schema_types' ],
842 + $css_class = 'schema_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
843 + $obj_label ) . '</p>' . "\n";
844 + }
845 +
846 + if ( ! empty( $type_select ) ) {
847 +
848 + $table_rows[ 'schema_type_for_pta' ] = $form->get_tr_hide( $in_view = 'basic', $type_keys ) .
849 + $form->get_th_html( _x( 'Type by Post Type Archive', 'option label', 'wpsso' ),
850 + $css_class = '', $css_id = 'schema_type_for_pta' ) .
851 + '<td class="blank">' . $type_select . '</td>';
852 + }
853 +
854 + /*
855 + * Schema Type by Taxonomy.
856 + */
857 + $type_select = '';
858 + $type_keys = array();
859 + $type_labels = SucomUtilWP::get_taxonomy_labels( $val_prefix = 'schema_type_for_tax_' );
860 +
861 + foreach ( $type_labels as $opt_key => $obj_label ) {
862 +
863 + $type_keys[] = $opt_key;
864 +
865 + $type_select .= '<p>' . $form->get_no_select( $opt_key, $args[ 'select' ][ 'schema_types' ],
866 + $css_class = 'schema_type' ) . ' ' . sprintf( _x( 'for %s', 'option comment', 'wpsso' ),
867 + $obj_label ) . '</p>' . "\n";
868 + }
869 +
870 + $table_rows[ 'schema_type_for_tax' ] = $form->get_tr_hide( $in_view = 'basic', $type_keys ) .
871 + $form->get_th_html( _x( 'Type by Taxonomy', 'option label', 'wpsso' ),
872 + $css_class = '', $css_id = 'schema_type_for_tax' ) .
873 + '<td class="blank">' . $type_select . '</td>';
874 +
875 + return $table_rows;
876 + }
877 +
878 + /*
879 + * Since WPSSO Core v13.5.0.
880 + */
881 + public function filter_mb_advanced_schema_defs_article_rows( $table_rows, $form, $args ) {
882 +
883 + $form_rows = array(
884 + 'wpsso_pro_feature_msg' => array(
885 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
886 + ),
887 + 'schema_def_add_articlebody_prop' => array(
888 + 'td_class' => 'blank',
889 + 'label' => _x( 'Add Article Body Property', 'option label', 'wpsso' ),
890 + 'tooltip' => 'schema_def_add_articlebody_prop',
891 + 'content' => $form->get_no_checkbox( 'schema_def_add_articlebody_prop' ),
892 + ),
893 + 'schema_def_article_section' => array(
894 + 'td_class' => 'blank',
895 + 'label' => _x( 'Default Article Section', 'option label', 'wpsso' ),
896 + 'tooltip' => 'schema_def_article_section',
897 + 'content' => $form->get_no_select( 'schema_def_article_section', $args[ 'select' ][ 'article_sections' ] ),
898 + ),
899 + );
900 +
901 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
902 +
903 + return $table_rows;
904 + }
905 +
906 + public function filter_mb_advanced_schema_defs_book_rows( $table_rows, $form, $args ) {
907 +
908 + $form_rows = array(
909 + 'wpsso_pro_feature_msg' => array(
910 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
911 + ),
912 + 'schema_def_book_format' => array(
913 + 'td_class' => 'blank',
914 + 'label' => _x( 'Default Book Format', 'option label', 'wpsso' ),
915 + 'tooltip' => 'schema_def_book_format',
916 + 'content' => $form->get_no_select( 'schema_def_book_format', $this->p->cf[ 'form' ][ 'book_format' ],
917 + $css_class = '', $css_id = '', $is_assoc = true ),
918 + ),
919 + 'schema_def_book_author_type' => array(
920 + 'td_class' => 'blank',
921 + 'label' => _x( 'Default Book Author Type', 'option label', 'wpsso' ),
922 + 'tooltip' => 'schema_def_book_author_type',
923 + 'content' => $form->get_no_select( 'schema_def_book_author_type', $this->p->cf[ 'form' ][ 'author_types' ],
924 + $css_class = '', $css_id = '', $is_assoc = true ),
925 + ),
926 + );
927 +
928 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
929 +
930 + return $table_rows;
931 + }
932 +
933 + public function filter_mb_advanced_schema_defs_creative_work_rows( $table_rows, $form, $args ) {
934 +
935 + $form_rows = array(
936 + 'wpsso_pro_feature_msg' => array(
937 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
938 + ),
939 + 'schema_def_add_date_created' => array(
940 + 'td_class' => 'blank',
941 + 'label' => _x( 'Add Date Created Property', 'option label', 'wpsso' ),
942 + 'tooltip' => 'schema_def_add_date_created',
943 + 'content' => $form->get_no_checkbox( 'schema_def_add_date_created' ),
944 + ),
945 + 'schema_def_add_date_published' => array(
946 + 'td_class' => 'blank',
947 + 'label' => _x( 'Add Date Published Property', 'option label', 'wpsso' ),
948 + 'tooltip' => 'schema_def_add_date_published',
949 + 'content' => $form->get_no_checkbox( 'schema_def_add_date_published' ),
950 + ),
951 + 'schema_def_add_date_modified' => array(
952 + 'td_class' => 'blank',
953 + 'label' => _x( 'Add Date Modified Property', 'option label', 'wpsso' ),
954 + 'tooltip' => 'schema_def_add_date_modified',
955 + 'content' => $form->get_no_checkbox( 'schema_def_add_date_modified' ),
956 + ),
957 + 'schema_def_add_text_prop' => array(
958 + 'td_class' => 'blank',
959 + 'label' => _x( 'Add Text Property', 'option label', 'wpsso' ),
960 + 'tooltip' => 'schema_def_add_text_prop',
961 + 'content' => $form->get_no_checkbox( 'schema_def_add_text_prop' ),
962 + ),
963 + 'schema_def_family_friendly' => array(
964 + 'td_class' => 'blank',
965 + 'label' => _x( 'Default Family Friendly', 'option label', 'wpsso' ),
966 + 'tooltip' => 'schema_def_family_friendly',
967 + 'content' => $form->get_no_select_none( 'schema_def_family_friendly',
968 + $this->p->cf[ 'form' ][ 'yes_no' ], $css_class = 'yes-no', $css_id = '', $is_assoc = true ),
969 + ),
970 + 'schema_def_pub_org_id' => array(
971 + 'td_class' => 'blank',
972 + 'label' => _x( 'Default Publisher Organization', 'option label', 'wpsso' ),
973 + 'tooltip' => 'schema_def_pub_org_id',
974 + 'content' => $form->get_no_select( 'schema_def_pub_org_id', $args[ 'select' ][ 'org' ],
975 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
976 + ),
977 + 'schema_def_pub_person_id' => array(
978 + 'td_class' => 'blank',
979 + 'label' => _x( 'Default Publisher Person', 'option label', 'wpsso' ),
980 + 'tooltip' => 'schema_def_pub_person_id',
981 + 'content' => $form->get_no_select( 'schema_def_pub_person_id', $args[ 'select' ][ 'person' ],
982 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
983 + ),
984 + 'schema_def_prov_org_id' => array(
985 + 'td_class' => 'blank',
986 + 'label' => _x( 'Default Provider Organization', 'option label', 'wpsso' ),
987 + 'tooltip' => 'schema_def_prov_org_id',
988 + 'content' => $form->get_no_select( 'schema_def_prov_org_id', $args[ 'select' ][ 'org' ],
989 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
990 + ),
991 + 'schema_def_prov_person_id' => array(
992 + 'td_class' => 'blank',
993 + 'label' => _x( 'Default Provider Person', 'option label', 'wpsso' ),
994 + 'tooltip' => 'schema_def_prov_person_id',
995 + 'content' => $form->get_no_select( 'schema_def_prov_person_id', $args[ 'select' ][ 'person' ],
996 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
997 + ),
998 + 'schema_def_fund_org_id' => array(
999 + 'td_class' => 'blank',
1000 + 'label' => _x( 'Default Funder Organization', 'option label', 'wpsso' ),
1001 + 'tooltip' => 'schema_def_fund_org_id',
1002 + 'content' => $form->get_no_select( 'schema_def_fund_org_id', $args[ 'select' ][ 'org' ],
1003 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1004 + ),
1005 + 'schema_def_fund_person_id' => array(
1006 + 'td_class' => 'blank',
1007 + 'label' => _x( 'Default Funder Person', 'option label', 'wpsso' ),
1008 + 'tooltip' => 'schema_def_fund_person_id',
1009 + 'content' => $form->get_no_select( 'schema_def_fund_person_id', $args[ 'select' ][ 'person' ],
1010 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1011 + ),
1012 + );
1013 +
1014 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1015 +
1016 + return $table_rows;
1017 + }
1018 +
1019 + public function filter_mb_advanced_schema_defs_event_rows( $table_rows, $form, $args ) {
1020 +
1021 + $form_rows = array(
1022 + 'wpsso_pro_feature_msg' => array(
1023 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
1024 + ),
1025 + 'schema_def_event_attendance' => array(
1026 + 'td_class' => 'blank',
1027 + 'label' => _x( 'Default Event Attendance', 'option label', 'wpsso' ),
1028 + 'tooltip' => 'schema_def_event_attendance',
1029 + 'content' => $form->get_no_select( 'schema_def_event_attendance', $this->p->cf[ 'form' ][ 'event_attendance' ],
1030 + $css_class = '', $css_id = '', $is_assoc = true ),
1031 + ),
1032 + 'schema_def_event_location_id' => array(
1033 + 'td_class' => 'blank',
1034 + 'label' => _x( 'Default Event Venue', 'option label', 'wpsso' ),
1035 + 'tooltip' => 'schema_def_event_location_id',
1036 + 'content' => $form->get_no_select( 'schema_def_event_location_id', $args[ 'select' ][ 'place' ],
1037 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1038 + ),
1039 + 'schema_def_event_performer_org_id' => array(
1040 + 'td_class' => 'blank',
1041 + 'label' => _x( 'Default Event Performer Org.', 'option label', 'wpsso' ),
1042 + 'tooltip' => 'schema_def_event_performer_org_id',
1043 + 'content' => $form->get_no_select( 'schema_def_event_performer_org_id', $args[ 'select' ][ 'org' ],
1044 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1045 + ),
1046 + 'schema_def_event_performer_person_id' => array(
1047 + 'td_class' => 'blank',
1048 + 'label' => _x( 'Default Event Performer Person', 'option label', 'wpsso' ),
1049 + 'tooltip' => 'schema_def_event_performer_person_id',
1050 + 'content' => $form->get_no_select( 'schema_def_event_performer_person_id', $args[ 'select' ][ 'person' ],
1051 + $css_class = 'wide' ),
1052 + ),
1053 + 'schema_def_event_organizer_org_id' => array(
1054 + 'td_class' => 'blank',
1055 + 'label' => _x( 'Default Event Organizer Org.', 'option label', 'wpsso' ),
1056 + 'tooltip' => 'schema_def_event_organizer_org_id',
1057 + 'content' => $form->get_no_select( 'schema_def_event_organizer_org_id', $args[ 'select' ][ 'org' ],
1058 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1059 + ),
1060 + 'schema_def_event_organizer_person_id' => array(
1061 + 'td_class' => 'blank',
1062 + 'label' => _x( 'Default Event Organizer Person', 'option label', 'wpsso' ),
1063 + 'tooltip' => 'schema_def_event_organizer_person_id',
1064 + 'content' => $form->get_no_select( 'schema_def_event_organizer_person_id', $args[ 'select' ][ 'person' ],
1065 + $css_class = 'wide' ),
1066 + ),
1067 + 'schema_def_event_fund_org_id' => array(
1068 + 'td_class' => 'blank',
1069 + 'label' => _x( 'Default Event Funder Org.', 'option label', 'wpsso' ),
1070 + 'tooltip' => 'schema_def_event_fund_org_id',
1071 + 'content' => $form->get_no_select( 'schema_def_event_fund_org_id', $args[ 'select' ][ 'org' ],
1072 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1073 + ),
1074 + 'schema_def_event_fund_person_id' => array(
1075 + 'td_class' => 'blank',
1076 + 'label' => _x( 'Default Event Funder Person', 'option label', 'wpsso' ),
1077 + 'tooltip' => 'schema_def_event_fund_person_id',
1078 + 'content' => $form->get_no_select( 'schema_def_event_fund_person_id', $args[ 'select' ][ 'person' ],
1079 + $css_class = 'wide' ),
1080 + ),
1081 + );
1082 +
1083 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1084 +
1085 + return $table_rows;
1086 + }
1087 +
1088 + public function filter_mb_advanced_schema_defs_job_posting_rows( $table_rows, $form, $args ) {
1089 +
1090 + $form_rows = array(
1091 + 'wpsso_pro_feature_msg' => array(
1092 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
1093 + ),
1094 + 'schema_def_job_hiring_org_id' => array(
1095 + 'td_class' => 'blank',
1096 + 'label' => _x( 'Default Job Hiring Org.', 'option label', 'wpsso' ),
1097 + 'tooltip' => 'schema_def_job_hiring_org_id',
1098 + 'content' => $form->get_no_select( 'schema_def_job_hiring_org_id', $args[ 'select' ][ 'org' ],
1099 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1100 + ),
1101 + 'schema_def_job_location_id' => array(
1102 + 'td_class' => 'blank',
1103 + 'label' => _x( 'Default Job Location', 'option label', 'wpsso' ),
1104 + 'tooltip' => 'schema_def_job_location_id',
1105 + 'content' => $form->get_no_select( 'schema_def_job_location_id', $args[ 'select' ][ 'place' ],
1106 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1107 + ),
1108 + 'schema_def_job_location_type' => array(
1109 + 'td_class' => 'blank',
1110 + 'label' => _x( 'Default Job Location Type', 'option label', 'wpsso' ),
1111 + 'tooltip' => 'schema_def_job_location_type',
1112 + 'content' => $form->get_no_select( 'schema_def_job_location_type', $this->p->cf[ 'form' ][ 'job_location_type' ],
1113 + $css_class = 'long_name', $css_id = '', $is_assoc = true ),
1114 + ),
1115 + );
1116 +
1117 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1118 +
1119 + return $table_rows;
1120 + }
1121 +
1122 + public function filter_mb_advanced_schema_defs_place_rows( $table_rows, $form, $args ) {
1123 +
1124 + $form_rows = array(
1125 + 'wpsso_pro_feature_msg' => array(
1126 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
1127 + ),
1128 + 'schema_def_place_schema_type' => array(
1129 + 'td_class' => 'blank',
1130 + 'label' => _x( 'Default Place Schema Type', 'option label', 'wpsso' ),
1131 + 'tooltip' => 'schema_def_place_schema_type',
1132 + 'content' => $form->get_no_select( 'schema_def_place_schema_type', $args[ 'select' ][ 'place_types' ],
1133 + $css_class = 'schema_type' ),
1134 + ),
1135 + 'schema_def_place_country' => array(
1136 + 'td_class' => 'blank',
1137 + 'label' => _x( 'Default Place Country', 'option label', 'wpsso' ),
1138 + 'tooltip' => 'schema_def_place_country',
1139 + 'content' => $form->get_no_select_country( 'schema_def_place_country' ),
1140 + ),
1141 + 'schema_def_place_timezone' => array(
1142 + 'td_class' => 'blank',
1143 + 'label' => _x( 'Default Place Timezone', 'option label', 'wpsso' ),
1144 + 'tooltip' => 'schema_def_place_country',
1145 + 'content' => $form->get_no_select_timezone( 'schema_def_place_timezone' ),
1146 + ),
1147 + );
1148 +
1149 +
1150 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1151 +
1152 + return $table_rows;
1153 + }
1154 +
1155 + public function filter_mb_advanced_schema_defs_product_rows( $table_rows, $form, $args ) {
1156 +
1157 + $form_rows = array(
1158 + 'wpsso_pro_feature_msg' => array(
1159 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
1160 + ),
1161 + 'schema_def_product_aggr_offers' => array(
1162 + 'td_class' => 'blank',
1163 + 'label' => _x( 'Aggregate Offers by Currency', 'option label', 'wpsso' ),
1164 + 'tooltip' => 'schema_def_product_aggr_offers',
1165 + 'content' => $form->get_no_checkbox( 'schema_def_product_aggr_offers' ) . ' ' .
1166 + sprintf( _x( '(not compatible with <a href="%s">price drop appearance</a>)', 'option comment', 'wpsso' ),
1167 + 'https://developers.google.com/search/docs/data-types/product#price-drop'),
1168 + ),
1169 + 'schema_def_product_price_valid_days' => array(
1170 + 'td_class' => 'blank',
1171 + 'label' => _x( 'Default Product Prices Valid For', 'option label', 'wpsso' ),
1172 + 'tooltip' => 'schema_def_product_price_valid_days',
1173 + 'content' => $form->get_no_input( 'schema_def_product_price_valid_days', $css_class = 'short' ) . ' ' .
1174 + _x( 'Days', 'option comment', 'wpsso' ),
1175 + ),
1176 + 'schema_def_product_mrp' => array(
1177 + 'td_class' => 'blank',
1178 + 'label' => _x( 'Default Product Return Policy', 'option label', 'wpsso' ),
1179 + 'tooltip' => 'schema_def_product_mrp',
1180 + 'content' => $form->get_no_select( 'schema_def_product_mrp', $args[ 'select' ][ 'mrp' ],
1181 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1182 + ),
1183 + 'schema_def_product_category' => array( // Product Google Category ID.
1184 + 'td_class' => 'blank',
1185 + 'label' => _x( 'Default Product Google Category', 'option label', 'wpsso' ),
1186 + 'tooltip' => 'schema_def_product_category',
1187 + 'content' => $form->get_no_select( 'schema_def_product_category', $args[ 'select' ][ 'google_prod_cats' ],
1188 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1189 + ),
1190 + 'schema_def_product_condition' => array(
1191 + 'td_class' => 'blank',
1192 + 'label' => _x( 'Default Product Condition', 'option label', 'wpsso' ),
1193 + 'tooltip' => 'schema_def_product_condition',
1194 + 'content' => $form->get_no_select( 'schema_def_product_condition', $this->p->cf[ 'form' ][ 'item_condition' ] ),
1195 + ),
1196 + 'schema_def_product_energy_efficiency_min_max' => array(
1197 + 'td_class' => 'blank',
1198 + 'label' => _x( 'Default Product Energy Rating Range', 'option label', 'wpsso' ),
1199 + 'tooltip' => 'schema_def_product_energy_efficiency_min_max',
1200 + 'content' => '' .
1201 + $form->get_no_select( 'schema_def_product_energy_efficiency_min', $this->p->cf[ 'form' ][ 'energy_efficiency' ],
1202 + $css_class = 'energy_efficiency', $css_id = '', $is_assoc = 'sorted' ) . ' ' .
1203 + _x( 'to', 'option comment', 'wpsso' ) . ' ' .
1204 + $form->get_no_select( 'schema_def_product_energy_efficiency_max', $this->p->cf[ 'form' ][ 'energy_efficiency' ],
1205 + $css_class = 'energy_efficiency', $css_id = '', $is_assoc = 'sorted' ),
1206 + ),
1207 + 'schema_def_product_target_gender' => array(
1208 + 'td_class' => 'blank',
1209 + 'label' => _x( 'Default Product Target Gender', 'option label', 'wpsso' ),
1210 + 'tooltip' => 'schema_def_product_target_gender',
1211 + 'content' => $form->get_no_select( 'schema_def_product_target_gender', $this->p->cf[ 'form' ][ 'target_gender' ],
1212 + $css_class = 'gender', $css_id = '', $is_assoc = true ),
1213 + ),
1214 + 'schema_def_product_size_group' => array(
1215 + 'td_class' => 'blank',
1216 + 'label' => _x( 'Default Product Size Group', 'option label', 'wpsso' ),
1217 + 'tooltip' => 'schema_def_product_size_group',
1218 + 'content' => '' .
1219 + $form->get_no_select( 'schema_def_product_size_group_0', $this->p->cf[ 'form' ][ 'size_group' ],
1220 + $css_class = 'size_group', $css_id = '', $is_assoc = true ) . ' ' .
1221 + $form->get_no_select( 'schema_def_product_size_group_1', $this->p->cf[ 'form' ][ 'size_group' ],
1222 + $css_class = 'size_group', $css_id = '', $is_assoc = true ),
1223 + ),
1224 + 'schema_def_product_size_system' => array(
1225 + 'td_class' => 'blank',
1226 + 'label' => _x( 'Default Product Size System', 'option label', 'wpsso' ),
1227 + 'tooltip' => 'schema_def_product_size_system',
1228 + 'content' => $form->get_no_select( 'schema_def_product_size_system', $this->p->cf[ 'form' ][ 'size_system' ] ),
1229 + ),
1230 + 'schema_def_product_age_group' => array(
1231 + 'td_class' => 'blank',
1232 + 'label' => _x( 'Default Product Age Group', 'option label', 'wpsso' ),
1233 + 'tooltip' => 'schema_def_product_age_group',
1234 + 'content' => $form->get_no_select( 'schema_def_product_age_group', $this->p->cf[ 'form' ][ 'age_group' ] ),
1235 + ),
1236 + 'schema_def_product_adult_type' => array(
1237 + 'td_class' => 'blank',
1238 + 'label' => _x( 'Default Product Adult Type', 'option label', 'wpsso' ),
1239 + 'tooltip' => 'schema_def_product_adult_type',
1240 + 'content' => $form->get_no_select( 'schema_def_product_adult_type', $this->p->cf[ 'form' ][ 'adult_type' ] ),
1241 + ),
1242 + );
1243 +
1244 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1245 +
1246 + return $table_rows;
1247 + }
1248 +
1249 + public function filter_mb_advanced_schema_defs_profile_page_rows( $table_rows, $form, $args ) {
1250 +
1251 + $form_rows = array(
1252 + 'schema_def_profile_page_mentions_prop' => array(
1253 + 'td_class' => 'blank',
1254 + 'label' => _x( 'Add Mentions Property', 'option label', 'wpsso' ),
1255 + 'tooltip' => 'schema_def_profile_page_mentions_prop',
1256 + 'content' => $form->get_no_checkbox( 'schema_def_profile_page_mentions_prop' ),
1257 + ),
1258 + );
1259 +
1260 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1261 +
1262 + return $table_rows;
1263 + }
1264 +
1265 + public function filter_mb_advanced_schema_defs_review_rows( $table_rows, $form, $args ) {
1266 +
1267 + $form_rows = array(
1268 + 'wpsso_pro_feature_msg' => array(
1269 + 'table_row' => '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>',
1270 + ),
1271 + 'schema_def_review_rating_min' => array(
1272 + 'td_class' => 'blank',
1273 + 'label' => _x( 'Default Review Rating Min', 'option label', 'wpsso' ),
1274 + 'tooltip' => 'schema_def_review_rating_min',
1275 + 'content' => $form->get_no_input( 'schema_def_review_rating_min', $css_class = 'rating' ),
1276 + ),
1277 + 'schema_def_review_rating_max' => array(
1278 + 'td_class' => 'blank',
1279 + 'label' => _x( 'Default Review Rating Max', 'option label', 'wpsso' ),
1280 + 'tooltip' => 'schema_def_review_rating_max',
1281 + 'content' => $form->get_no_input( 'schema_def_review_rating_max', $css_class = 'rating' ),
1282 + ),
1283 + 'schema_def_review_item_type' => array(
1284 + 'td_class' => 'blank',
1285 + 'label' => _x( 'Default Subject Schema Type', 'option label', 'wpsso' ),
1286 + 'tooltip' => 'schema_def_review_item_type',
1287 + 'content' => $form->get_no_select( 'schema_def_review_item_type', $args[ 'select' ][ 'schema_types' ],
1288 + $css_class = 'schema_type' ),
1289 + ),
1290 + );
1291 +
1292 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1293 +
1294 + return $table_rows;
1295 + }
1296 +
1297 + public function filter_mb_advanced_schema_defs_service_rows( $table_rows, $form, $args ) {
1298 +
1299 + $form_rows = array(
1300 + 'schema_def_service_prov_org_id' => array(
1301 + 'td_class' => 'blank',
1302 + 'label' => _x( 'Default Service Provider Org.', 'option label', 'wpsso' ),
1303 + 'tooltip' => 'schema_def_service_prov_org_id',
1304 + 'content' => $form->get_no_select( 'schema_def_service_prov_org_id', $args[ 'select' ][ 'org' ],
1305 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1306 + ),
1307 + 'schema_def_service_prov_person_id' => array(
1308 + 'td_class' => 'blank',
1309 + 'label' => _x( 'Default Service Provider Person', 'option label', 'wpsso' ),
1310 + 'tooltip' => 'schema_def_service_prov_person_id',
1311 + 'content' => $form->get_no_select( 'schema_def_service_prov_person_id', $args[ 'select' ][ 'person' ],
1312 + $css_class = 'wide', $css_id = '', $is_assoc = true ),
1313 + ),
1314 + );
1315 +
1316 + $table_rows = $form->get_md_form_rows( $table_rows, $form_rows );
1317 +
1318 + return $table_rows;
1319 + }
1320 +
1321 + /*
1322 + * Contact Fields > Default Contacts tab.
1323 + */
1324 + public function filter_mb_advanced_contact_fields_default_cm_rows( $table_rows, $form, $args ) {
1325 +
1326 + $table_rows[] = '<td colspan="4">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
1327 +
1328 + $table_rows[] = '<th class="medium"></th>' .
1329 + $form->get_th_html( _x( 'Show', 'column title', 'wpsso' ), $css_class = 'checkbox left', 'custom-cm-show-checkbox' ) .
1330 + $form->get_th_html( _x( 'Contact Field ID', 'column title', 'wpsso' ), $css_class = 'medium left', 'wp-cm-field-id' ) .
1331 + $form->get_th_html_locale( _x( 'Contact Field Label', 'column title', 'wpsso' ), $css_class = 'wide left', 'custom-cm-field-label' );
1332 +
1333 + $sorted_cm_names = $this->p->cf[ 'wp' ][ 'cm_names' ];
1334 +
1335 + ksort( $sorted_cm_names );
1336 +
1337 + foreach ( $sorted_cm_names as $cm_id => $opt_label ) {
1338 +
1339 + $cm_enabled_key = 'wp_cm_' . $cm_id . '_enabled';
1340 + $cm_name_key = 'wp_cm_' . $cm_id . '_name';
1341 + $cm_label_key = 'wp_cm_' . $cm_id . '_label';
1342 +
1343 + /*
1344 + * Not all social websites have a contact method field.
1345 + */
1346 + if ( ! isset( $form->options[ $cm_enabled_key ] ) ) {
1347 +
1348 + continue;
1349 + }
1350 +
1351 + $table_rows[] = '' .
1352 + $form->get_th_html( $opt_label, $css_class = 'medium' ) .
1353 + $form->get_no_td_checkbox( $cm_enabled_key, $comment = '', $extra_css_class = 'checkbox' ) .
1354 + '<td class="blank medium">' . $form->get_no_input( $cm_name_key, $css_class = 'medium' ) . '</td>' .
1355 + '<td class="blank wide">' . $form->get_no_input_locale( $cm_label_key ) . '</td>';
1356 + }
1357 +
1358 + return $table_rows;
1359 + }
1360 +
1361 + /*
1362 + * Contact Fields > Custom Contacts tab.
1363 + */
1364 + public function filter_mb_advanced_contact_fields_custom_cm_rows( $table_rows, $form, $args ) {
1365 +
1366 + $table_rows[] = '<td colspan="4">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
1367 +
1368 + $table_rows[] = '<th class="medium"></th>' .
1369 + $form->get_th_html( _x( 'Show', 'column title', 'wpsso' ), $css_class = 'checkbox left', 'custom-cm-show-checkbox' ) .
1370 + $form->get_th_html( _x( 'Contact Field ID', 'column title', 'wpsso' ), $css_class = 'medium left', 'custom-cm-field-id' ) .
1371 + $form->get_th_html_locale( _x( 'Contact Field Label', 'column title', 'wpsso' ), $css_class = 'wide left', 'custom-cm-field-label' );
1372 +
1373 + foreach ( $this->p->cf[ 'opt' ][ 'cm_prefix' ] as $cm_id => $opt_pre ) {
1374 +
1375 + $cm_enabled_key = 'plugin_cm_' . $opt_pre . '_enabled';
1376 + $cm_name_key = 'plugin_cm_' . $opt_pre . '_name';
1377 + $cm_label_key = 'plugin_cm_' . $opt_pre . '_label';
1378 +
1379 + if ( isset( $form->options[ $cm_enabled_key ] ) ) {
1380 +
1381 + $table_rows[] = '' .
1382 + $form->get_th_html( ucfirst( $cm_id ), $css_class = 'medium' ) .
1383 + $form->get_no_td_checkbox( $cm_enabled_key, $comment = '', $extra_css_class = 'checkbox' ) .
1384 + '<td class="blank medium">' . $form->get_no_input( $cm_name_key, $css_class = 'medium' ) . '</td>' .
1385 + '<td class="blank wide">' . $form->get_no_input_locale( $cm_label_key ) . '</td>';
1386 + }
1387 + }
1388 +
1389 + return $table_rows;
1390 + }
1391 +
1392 + /*
1393 + * About the User metabox.
1394 + */
1395 + public function filter_mb_advanced_user_about_rows( $table_rows, $form, $args ) {
1396 +
1397 + $table_rows[] = '<td colspan="3">' . $this->p->msgs->get( 'info-user-about' ) . '</td>';
1398 +
1399 + $table_rows[] = '<td colspan="3">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
1400 +
1401 + $table_rows[] = '<th></th>' .
1402 + $form->get_th_html( _x( 'Show', 'column title', 'wpsso' ),
1403 + $css_class = 'checkbox left', $css_id = 'user-about-show-checkbox' ) .
1404 + '<td class="wide"></td>';
1405 +
1406 + foreach ( $this->p->cf[ 'opt' ][ 'user_about' ] as $key => $opt_label ) {
1407 +
1408 + $opt_key = 'plugin_user_about_' . $key;
1409 +
1410 + $table_rows[ $opt_key ] = '' .
1411 + $form->get_th_html( _x( $opt_label, 'option label', 'wpsso' ), '', $opt_key ) .
1412 + $form->get_no_td_checkbox( $opt_key, $comment = '', $extra_css_class = 'checkbox' );
1413 + }
1414 +
1415 + return $table_rows;
1416 + }
1417 +
1418 + /*
1419 + * Attributes and Metadata > Product Attributes tab.
1420 + */
1421 + public function filter_mb_advanced_metadata_product_attrs_rows( $table_rows, $form, $args ) {
1422 +
1423 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->get( 'info-product-attrs' ) . '</td>';
1424 +
1425 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
1426 +
1427 + $opts_transl = SucomUtilOptions::get_opts_labels_transl( $this->p->cf[ 'form' ][ 'attr_labels' ], $text_domain = 'wpsso' );
1428 +
1429 + foreach ( $opts_transl as $opt_key => $opt_label_transl ) {
1430 +
1431 + $cmt_transl = WpssoAdmin::get_option_unit_comment( $opt_key );
1432 +
1433 + $table_rows[ $opt_key ] = '' .
1434 + $form->get_th_html_locale( $opt_label_transl, '', $opt_key ) .
1435 + '<td class="blank">' . $form->get_no_input_locale( $opt_key ) . $cmt_transl . '</td>';
1436 + }
1437 +
1438 + return $table_rows;
1439 + }
1440 +
1441 + /*
1442 + * Attributes and Metadata > Custom Fields tab.
1443 + */
1444 + public function filter_mb_advanced_metadata_custom_fields_rows( $table_rows, $form, $args ) {
1445 +
1446 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->get( 'info-custom-fields' ) . '</td>';
1447 +
1448 + $table_rows[] = '<td colspan="2">' . $this->p->msgs->pro_feature( 'wpsso' ) . '</td>';
1449 +
1450 + $opts_labels = array();
1451 + $cf_md_index = WpssoConfig::get_cf_md_index(); // Uses a local cache.
1452 +
1453 + foreach ( $cf_md_index as $opt_cf_key => $md_key ) {
1454 +
1455 + /*
1456 + * Make sure we have a label for the custom field option.
1457 + */
1458 + if ( ! empty( $this->p->cf[ 'form' ][ 'cf_labels' ][ $opt_cf_key ] ) ) {
1459 +
1460 + $opts_labels[ $opt_cf_key ] = $this->p->cf[ 'form' ][ 'cf_labels' ][ $opt_cf_key ];
1461 + }
1462 + }
1463 +
1464 + $opts_transl = SucomUtilOptions::get_opts_labels_transl( $opts_labels, $text_domain = 'wpsso' );
1465 +
1466 + foreach ( $opts_transl as $opt_cf_key => $opt_label_transl ) {
1467 +
1468 + /*
1469 + * If we don't have a meta data options key, then clear the custom field name (just in case) and
1470 + * disable the option.
1471 + */
1472 + if ( empty( $cf_md_index[ $opt_cf_key ] ) ) {
1473 +
1474 + $form->options[ $opt_cf_key ] = '';
1475 + }
1476 +
1477 + $cmt_transl = WpssoAdmin::get_option_unit_comment( $opt_cf_key );
1478 +
1479 + $table_rows[ $opt_cf_key ] = '' .
1480 + $form->get_th_html( $opt_label_transl, '', $opt_cf_key ) .
1481 + '<td class="blank">' . $form->get_no_input( $opt_cf_key, $css_class = '', $css_id = '', $holder = '' ) . $cmt_transl . '</td>';
1482 + }
1483 +
1484 + return $table_rows;
1485 + }
1486 +
1487 + /*
1488 + * HTML Tags > Facebook tab.
1489 + */
1490 + public function filter_mb_advanced_head_tags_facebook_rows( $table_rows, $form, $args ) {
1491 +
1492 + return $this->get_head_tags_rows( $table_rows, $form, array( '/^add_(meta)_(property)_((fb|al):.+)$/' ) );
1493 + }
1494 +
1495 + /*
1496 + * HTML Tags > Open Graph tab.
1497 + */
1498 + public function filter_mb_advanced_head_tags_open_graph_rows( $table_rows, $form, $args ) {
1499 +
1500 + return $this->get_head_tags_rows( $table_rows, $form, array( '/^add_(meta)_(property)_(.+)$/' ) );
1501 + }
1502 +
1503 + /*
1504 + * HTML Tags > X (Twitter) tab.
1505 + */
1506 + public function filter_mb_advanced_head_tags_twitter_rows( $table_rows, $form, $args ) {
1507 +
1508 + return $this->get_head_tags_rows( $table_rows, $form, array( '/^add_(meta)_(name)_(twitter:.+)$/' ) );
1509 + }
1510 +
1511 + /*
1512 + * HTML Tags > SEO / Other tab.
1513 + */
1514 + public function filter_mb_advanced_head_tags_seo_other_rows( $table_rows, $form, $args ) {
1515 +
1516 + if ( ! empty( $this->p->avail[ 'seo' ][ 'any' ] ) ) {
1517 +
1518 + $table_rows[] = '<td colspan="8"><blockquote class="top-info"><p>' .
1519 + __( 'An SEO plugin has been detected - some basic SEO meta tags have been unchecked and disabled automatically.', 'wpsso' ) .
1520 + '</p></blockquote></td>';
1521 + }
1522 +
1523 + return $this->get_head_tags_rows( $table_rows, $form, array( '/^add_(link)_([^_]+)_(.+)$/', '/^add_(meta)_(name)_(.+)$/' ) );
1524 + }
1525 +
1526 + private function get_head_tags_rows( $table_rows, $form, array $opt_preg_include ) {
1527 +
1528 + $table_cells = array();
1529 +
1530 + foreach ( $opt_preg_include as $preg ) {
1531 +
1532 + foreach ( $form->defaults as $opt_key => $opt_val ) {
1533 +
1534 + if ( strpos( $opt_key, 'add_' ) !== 0 ) { // Optimize
1535 +
1536 + continue;
1537 +
1538 + } elseif ( ! empty( $this->html_tag_shown[ $opt_key ] ) ) { // Check cache for HTML tags already shown.
1539 +
1540 + continue;
1541 +
1542 + } elseif ( ! preg_match( $preg, $opt_key, $match ) ) { // Check option name for a match.
1543 +
1544 + continue;
1545 + }
1546 +
1547 + $css_class = '';
1548 + $css_id = '';
1549 + $force = null;
1550 + $group = null;
1551 + $extra_class = '';
1552 +
1553 + $this->html_tag_shown[ $opt_key ] = true;
1554 +
1555 + switch ( $opt_key ) {
1556 +
1557 + case 'add_meta_name_generator': // Disabled with a constant instead.
1558 +
1559 + continue 2;
1560 +
1561 + case 'add_link_rel_shortlink':
1562 +
1563 + $group = 'add_link_rel_shortlink';
1564 +
1565 + break;
1566 + }
1567 +
1568 + $table_cells[] = '<!-- ' . ( implode( ' ', $match ) ) . ' -->' . // Required for sorting.
1569 + '<td class="checkbox blank">' . $form->get_no_checkbox( $opt_key, $css_class, $css_id, $force, $group ) . '</td>' .
1570 + '<td class="head_tags' . $extra_class . '">' . $match[ 1 ] . '</td>' .
1571 + '<td class="head_tags' . $extra_class . '">' . $match[ 2 ] . '</td>' .
1572 + '<th class="head_tags' . $extra_class . '">' . $match[ 3 ] . '</th>';
1573 + }
1574 + }
1575 +
1576 + return array_merge( $table_rows, $this->p->admin->get_table_rows_cols( $table_cells, 2 ) );
1577 + }
1578 + }
1579 +}