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
wpsso / lib / edit-schema.php

edit-schema.php in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at lib/edit-schema.php

2,353 lines 109.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * License: GPLv3
4 * License URI: https://www.gnu.org/licenses/gpl.txt
5 * Copyright 2020-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 ( ! defined( 'WPSSO_PLUGINDIR' ) ) {
14
15 die( 'Do. Or do not. There is no try.' );
16 }
17
18 if ( ! class_exists( 'WpssoEditSchema' ) ) {
19
20 class WpssoEditSchema {
21
22 private $p; // Wpsso class object.
23
24 public function __construct( &$plugin ) {
25
26 $this->p =& $plugin;
27
28 if ( $this->p->debug->enabled ) {
29
30 $this->p->debug->mark();
31 }
32
33 /*
34 * See WpssoAbstractWpMeta->get_document_sso_tabs().
35 */
36 $this->p->util->add_plugin_filters( $this, array(
37 'mb_sso_edit_schema_rows' => 4,
38 'mb_sso_edit_schema_creative_work_rows' => 5, // Schema CreativeWork.
39 'mb_sso_edit_schema_article_rows' => 5, // Schema CreativeWork > Article.
40 'mb_sso_edit_schema_book_rows' => 5, // Schema CreativeWork > Book.
41 'mb_sso_edit_schema_howto_rows' => 5, // Schema CreativeWork > HowTo.
42 'mb_sso_edit_schema_recipe_rows' => 5, // Schema CreativeWork > HowTo > Recipe.
43 'mb_sso_edit_schema_learningresource_rows' => 5, // Schema CreativeWork > LearningResource.
44 'mb_sso_edit_schema_movie_rows' => 5, // Schema CreativeWork > Movie.
45 'mb_sso_edit_schema_review_rows' => 5, // Schema CreativeWork > Review.
46 'mb_sso_edit_schema_software_app_rows' => 5, // Schema CreativeWork > Software Application.
47 'mb_sso_edit_schema_webpage_rows' => 5, // Schema CreativeWork > WebPage.
48 'mb_sso_edit_schema_profilepage_rows' => 5, // Schema CreativeWork > WebPage > ProfilePage.
49 'mb_sso_edit_schema_qa_rows' => 5, // Schema CreativeWork > WebPage > QAPage.
50 'mb_sso_edit_schema_event_rows' => 5, // Schema Event.
51 'mb_sso_edit_schema_job_posting_rows' => 5, // Schema Intangible > JobPosting.
52 'mb_sso_edit_schema_organization_rows' => 5, // Schema Organization.
53 'mb_sso_edit_schema_person_rows' => 5, // Schema Person.
54 'mb_sso_edit_schema_place_rows' => 5, // Schema Place.
55 'mb_sso_edit_schema_product_rows' => 5, // Schema Product.
56 'mb_sso_edit_schema_service_rows' => 5, // Schema Service.
57 ), PHP_INT_MIN ); // Run before any add-on filters.
58 }
59
60 public function filter_mb_sso_edit_schema_rows( $table_rows, $form, $head_info, $mod ) {
61
62 if ( $this->p->util->is_schema_disabled() ) {
63
64 if ( $this->p->debug->enabled ) {
65
66 $this->p->debug->log( 'exiting early: schema markup is disabled' );
67 }
68
69 return $table_rows;
70 }
71
72 $def_schema_title = $this->p->page->get_title( $mod, $md_key = 'seo_title', $max_len = 'schema_title' );
73 $def_schema_title_alt = $this->p->page->get_title( $mod, $md_key = 'schema_title', $max_len = 'schema_title_alt' );
74 $def_schema_desc = $this->p->page->get_description( $mod, $md_key = 'seo_desc', $max_len = 'schema_desc' );
75 $input_limits = WpssoConfig::get_input_limits(); // Uses a local cache.
76 $schema_lang_disabled = $this->p->avail[ 'lang' ][ 'any' ] ? true : false;
77
78 $args = array(
79 'max_multi' => array(
80 'addl_type_url' => SucomUtil::get_const( 'WPSSO_SCHEMA_ADDL_TYPE_URL_MAX', 5 ),
81 'awards' => SucomUtil::get_const( 'WPSSO_SCHEMA_AWARDS_MAX', 5 ),
82 'citations' => SucomUtil::get_const( 'WPSSO_SCHEMA_CITATIONS_MAX', 5 ),
83 'howto_steps' => SucomUtil::get_const( 'WPSSO_SCHEMA_HOWTO_STEPS_MAX', 40 ),
84 'howto_supplies' => SucomUtil::get_const( 'WPSSO_SCHEMA_HOWTO_SUPPLIES_MAX', 30 ),
85 'howto_tools' => SucomUtil::get_const( 'WPSSO_SCHEMA_HOWTO_TOOLS_MAX', 20 ),
86 'ispartof_url' => SucomUtil::get_const( 'WPSSO_SCHEMA_ISPARTOF_URLS_MAX', 10 ),
87 'metadata_offers' => SucomUtil::get_const( 'WPSSO_SCHEMA_METADATA_OFFERS_MAX', 5 ),
88 'movie_actors' => SucomUtil::get_const( 'WPSSO_SCHEMA_MOVIE_ACTORS_MAX', 15 ),
89 'movie_directors' => SucomUtil::get_const( 'WPSSO_SCHEMA_MOVIE_DIRECTORS_MAX', 5 ),
90 'offer_catalogs' => SucomUtil::get_const( 'WPSSO_SCHEMA_OFFER_CATALOGS_MAX', 5 ),
91 'sameas_url' => SucomUtil::get_const( 'WPSSO_SCHEMA_SAMEAS_URLS_MAX', 5 ),
92 'service_areas' => SucomUtil::get_const( 'WPSSO_SCHEMA_SERVICE_AREAS_MAX', 5 ),
93 'reviewed_by' => SucomUtil::get_const( 'WPSSO_SCHEMA_WEBPAGE_REVIEWED_BY_MAX', 5 ),
94 'recipe_ingr' => SucomUtil::get_const( 'WPSSO_SCHEMA_RECIPE_INGREDIENTS_MAX', 40 ),
95 'recipe_inst' => SucomUtil::get_const( 'WPSSO_SCHEMA_RECIPE_INSTRUCTIONS_MAX', 40 ),
96 ),
97 'select' => array(
98 'service_areas' => $this->p->util->get_form_cache( 'service_areas_names', $add_none = true ),
99 'contact' => $this->p->util->get_form_cache( 'contact_names', $add_none = true ),
100 'google_prod_cats' => $this->p->util->get_google_product_categories(),
101 'mrp' => $this->p->util->get_form_cache( 'mrp_names', $add_none = true ),
102 'org' => $this->p->util->get_form_cache( 'org_names', $add_none = true ),
103 'person' => $this->p->util->get_form_cache( 'person_names', $add_none = true ),
104 'place' => $this->p->util->get_form_cache( 'place_names', $add_none = true ),
105 'place_custom' => $this->p->util->get_form_cache( 'place_names_custom', $add_none = true ),
106 'schema_types' => $this->p->util->get_form_cache( 'schema_types_select' ),
107 ),
108 'tr_class_schema' => WpssoSchema::get_schema_type_row_class( 'schema_type' ),
109 );
110
111 $form_rows = array(
112 'subsection_schema' => array(
113 'td_class' => 'subsection top',
114 'header' => 'h4',
115 'label' => _x( 'Schema Markup and Google Rich Results', 'metabox title', 'wpsso' )
116 ),
117 'info_schema_item_list' => array(
118 'tr_class' => $args[ 'tr_class_schema' ][ 'item.list' ],
119 'table_row' => '<td colspan="2">' . $this->p->msgs->get( 'info-meta-schema-item-list' ) . '</td>',
120 ),
121 'info_schema_question' => array(
122 'tr_class' => $args[ 'tr_class_schema' ][ 'question' ],
123 'table_row' => '<td colspan="2">' . $this->p->msgs->get( 'info-meta-schema-question' ) . '</td>',
124 ),
125 'info_schema_webpage_faq' => array(
126 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.faq' ],
127 'table_row' => '<td colspan="2">' . $this->p->msgs->get( 'info-meta-schema-webpage-faq' ) . '</td>',
128 ),
129 'info_schema_webpae_qa' => array(
130 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.qa' ],
131 'table_row' => '<td colspan="2">' . $this->p->msgs->get( 'info-meta-schema-webpage-qa' ) . '</td>',
132 ),
133 'schema_lang' => array(
134 'th_class' => 'medium',
135 'label' => _x( 'Language', 'option label', 'wpsso' ),
136 'tooltip' => 'meta-schema_lang',
137 'content' => $form->get_select( 'schema_lang', SucomUtilWP::get_available_locales(), $css_class = 'locale', $css_id = '',
138 $is_assoc = false, $schema_lang_disabled ),
139 ),
140 'schema_title' => array(
141 'th_class' => 'medium',
142 'label' => _x( 'Name', 'option label', 'wpsso' ),
143 'tooltip' => 'meta-schema_title',
144 'content' => $form->get_input_dep( 'schema_title', $css_class = 'wide', $css_id = '',
145 $input_limits[ 'schema_title' ], $def_schema_title, $is_disabled = false, $dep_id = 'seo_title' ),
146 ),
147 'schema_title_alt' => array(
148 'th_class' => 'medium',
149 'label' => _x( 'Alternate Name', 'option label', 'wpsso' ),
150 'tooltip' => 'meta-schema_title_alt',
151 'content' => $form->get_input_dep( 'schema_title_alt', $css_class = 'wide', $css_id = '',
152 $input_limits[ 'schema_title_alt' ], $def_schema_title_alt, $is_disabled = false, $dep_id = 'schema_title' ),
153 ),
154 'schema_desc' => array(
155 'th_class' => 'medium',
156 'label' => _x( 'Description', 'option label', 'wpsso' ),
157 'tooltip' => 'meta-schema_desc',
158 'content' => $form->get_textarea_dep( 'schema_desc', $css_class = '', $css_id = '',
159 $input_limits[ 'schema_desc' ], $def_schema_desc, $is_disabled = false, $dep_id = 'seo_desc' ),
160 ),
161 'schema_addl_type_url' => array(
162 'th_class' => 'medium',
163 'label' => _x( 'Microdata Type URLs', 'option label', 'wpsso' ),
164 'tooltip' => 'meta-schema_addl_type_url',
165 'content' => $form->get_input_multi( 'schema_addl_type_url', $css_class = 'wide', $css_id = '',
166 $args[ 'max_multi' ][ 'addl_type_url' ], $show_first = 1 ),
167 ),
168 'schema_sameas_url' => array(
169 'th_class' => 'medium',
170 'label' => _x( 'Same-As URLs', 'option label', 'wpsso' ),
171 'tooltip' => 'meta-schema_sameas_url',
172 'content' => $form->get_input_multi( 'schema_sameas_url', $css_class = 'wide', $css_id = '',
173 $args[ 'max_multi' ][ 'sameas_url' ], $show_first = 1 ),
174 ),
175 );
176
177 $table_rows = $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
178
179 foreach( array(
180 'wpsso_mb_sso_edit_schema_creative_work_rows',
181 'wpsso_mb_sso_edit_schema_article_rows',
182 'wpsso_mb_sso_edit_schema_book_rows',
183 'wpsso_mb_sso_edit_schema_howto_rows', // Schema CreativeWork > HowTo.
184 'wpsso_mb_sso_edit_schema_recipe_rows', // Schema CreativeWork > HowTo > Recipe.
185 'wpsso_mb_sso_edit_schema_learningresource_rows', // Schema CreativeWork > LearningResource.
186 'wpsso_mb_sso_edit_schema_movie_rows',
187 'wpsso_mb_sso_edit_schema_review_rows',
188 'wpsso_mb_sso_edit_schema_software_app_rows',
189 'wpsso_mb_sso_edit_schema_webpage_rows',
190 'wpsso_mb_sso_edit_schema_profilepage_rows', // Schema CreativeWork > WebPage > ProfilePage.
191 'wpsso_mb_sso_edit_schema_qa_rows',
192 'wpsso_mb_sso_edit_schema_event_rows',
193 'wpsso_mb_sso_edit_schema_job_posting_rows',
194 'wpsso_mb_sso_edit_schema_organization_rows',
195 'wpsso_mb_sso_edit_schema_person_rows',
196 'wpsso_mb_sso_edit_schema_place_rows',
197 'wpsso_mb_sso_edit_schema_product_rows',
198 'wpsso_mb_sso_edit_schema_service_rows',
199 ) as $filter_name ) {
200
201 if ( $this->p->debug->enabled ) {
202
203 $this->p->debug->log( 'applying filters "' . $filter_name . '"' );
204 }
205
206 $table_rows = apply_filters( $filter_name, $table_rows, $form, $head_info, $mod, $args );
207 }
208
209 return $table_rows;
210 }
211
212 /*
213 * Schema CreativeWork.
214 */
215 public function filter_mb_sso_edit_schema_creative_work_rows( $table_rows, $form, $head_info, $mod, $args ) {
216
217 $def_schema_headline = $this->p->page->get_title( $mod, $md_key = 'schema_title', $max_len = 'schema_headline' );
218 $def_schema_text = $this->p->page->get_text( $mod, $md_key = '', $max_len = 'schema_text' );
219 $def_schema_keywords_csv = $this->p->page->get_keywords_csv( $mod, $md_key = '' );
220 $input_limits = WpssoConfig::get_input_limits(); // Uses a local cache.
221
222 $form_rows = array(
223 'subsection_schema_creative_work' => array(
224 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
225 'td_class' => 'subsection',
226 'header' => 'h5',
227 'label' => _x( 'Creative Work Information', 'metabox title', 'wpsso' )
228 ),
229 'schema_headline' => array(
230 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
231 'th_class' => 'medium',
232 'label' => _x( 'Headline', 'option label', 'wpsso' ),
233 'tooltip' => 'meta-schema_headline',
234 'content' => $form->get_input_dep( 'schema_headline', $css_class = 'wide', $css_id = '',
235 $input_limits[ 'schema_headline' ], $def_schema_headline, $is_disabled = false, $dep_id = 'schema_title' ),
236 ),
237 'schema_text' => array(
238 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
239 'th_class' => 'medium',
240 'label' => _x( 'Full Text', 'option label', 'wpsso' ),
241 'tooltip' => 'meta-schema_text',
242 'content' => $form->get_textarea( 'schema_text', $css_class = 'full_text', $css_id = '', $max_len = 0, $def_schema_text ),
243 ),
244 'schema_keywords_csv' => array(
245 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
246 'th_class' => 'medium',
247 'label' => _x( 'Keywords', 'option label', 'wpsso' ),
248 'tooltip' => 'meta-schema_keywords_csv',
249 'content' => $form->get_input( 'schema_keywords_csv', $css_class = 'wide', $css_id = '', $max_len = 0, $def_schema_keywords_csv ),
250 ),
251 'schema_family_friendly' => array(
252 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
253 'th_class' => 'medium',
254 'label' => _x( 'Family Friendly', 'option label', 'wpsso' ),
255 'tooltip' => 'meta-schema_family_friendly',
256 'content' => $form->get_select_none( 'schema_family_friendly',
257 $this->p->cf[ 'form' ][ 'yes_no' ], $css_class = 'yes-no', $css_id = '', $is_assoc = true ),
258 ),
259 'schema_copyright_year' => array(
260 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
261 'th_class' => 'medium',
262 'label' => _x( 'Copyright Year', 'option label', 'wpsso' ),
263 'tooltip' => 'meta-schema_copyright_year',
264 'content' => $form->get_input( 'schema_copyright_year', $css_class = 'year', $css_id = '', $max_len = 0, $holder = true ),
265 ),
266 'schema_license_url' => array(
267 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
268 'th_class' => 'medium',
269 'label' => _x( 'License URL', 'option label', 'wpsso' ),
270 'tooltip' => 'meta-schema_license_url',
271 'content' => $form->get_input( 'schema_license_url', $css_class = 'wide' ),
272 ),
273 'schema_pub_org_id' => array(
274 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
275 'th_class' => 'medium',
276 'label' => _x( 'Publisher Organization', 'option label', 'wpsso' ),
277 'tooltip' => 'meta-schema_pub_org_id',
278 'content' => $form->get_select( 'schema_pub_org_id', $args[ 'select' ][ 'org' ],
279 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
280 $selected = false, $event_names = array( 'on_focus_load_json' ),
281 $event_args = array( 'json_var' => 'org_names' ) ),
282 ),
283 'schema_pub_person_id' => array(
284 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
285 'th_class' => 'medium',
286 'label' => _x( 'Publisher Person', 'option label', 'wpsso' ),
287 'tooltip' => 'meta-schema_pub_person_id',
288 'content' => $form->get_select( 'schema_pub_person_id', $args[ 'select' ][ 'person' ],
289 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
290 $selected = false, $event_names = array( 'on_focus_load_json' ),
291 $event_args = array( 'json_var' => 'person_names' ) ),
292 ),
293 'schema_prov_org_id' => array(
294 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
295 'th_class' => 'medium',
296 'label' => _x( 'Provider Organization', 'option label', 'wpsso' ),
297 'tooltip' => 'meta-schema_prov_org_id',
298 'content' => $form->get_select( 'schema_prov_org_id', $args[ 'select' ][ 'org' ],
299 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
300 $selected = false, $event_names = array( 'on_focus_load_json' ),
301 $event_args = array( 'json_var' => 'org_names' ) ),
302 ),
303 'schema_prov_person_id' => array(
304 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
305 'th_class' => 'medium',
306 'label' => _x( 'Provider Person', 'option label', 'wpsso' ),
307 'tooltip' => 'meta-schema_prov_person_id',
308 'content' => $form->get_select( 'schema_prov_person_id', $args[ 'select' ][ 'person' ],
309 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
310 $selected = false, $event_names = array( 'on_focus_load_json' ),
311 $event_args = array( 'json_var' => 'person_names' ) ),
312 ),
313 'schema_fund_org_id' => array(
314 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
315 'th_class' => 'medium',
316 'label' => _x( 'Funder Organization', 'option label', 'wpsso' ),
317 'tooltip' => 'meta-schema_fund_org_id',
318 'content' => $form->get_select( 'schema_fund_org_id', $args[ 'select' ][ 'org' ],
319 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
320 $selected = false, $event_names = array( 'on_focus_load_json' ),
321 $event_args = array( 'json_var' => 'org_names' ) ),
322 ),
323 'schema_fund_person_id' => array(
324 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
325 'th_class' => 'medium',
326 'label' => _x( 'Funder Person', 'option label', 'wpsso' ),
327 'tooltip' => 'meta-schema_fund_person_id',
328 'content' => $form->get_select( 'schema_fund_person_id', $args[ 'select' ][ 'person' ],
329 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
330 $selected = false, $event_names = array( 'on_focus_load_json' ),
331 $event_args = array( 'json_var' => 'person_names' ) ),
332 ),
333 'schema_ispartof_url' => array(
334 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
335 'th_class' => 'medium',
336 'label' => _x( 'Is Part of URLs', 'option label', 'wpsso' ),
337 'tooltip' => 'meta-schema_ispartof_url',
338 'content' => $form->get_input_multi( 'schema_ispartof_url', $css_class = 'wide', $css_id = '',
339 $args[ 'max_multi' ][ 'ispartof_url' ], $show_first = 1 ),
340 ),
341 'schema_award' => array(
342 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
343 'th_class' => 'medium',
344 'label' => _x( 'Creative Work Awards', 'option label', 'wpsso' ),
345 'tooltip' => 'meta-schema_award',
346 'content' => $form->get_input_multi( 'schema_award', $css_class = 'wide', $css_id = '',
347 $args[ 'max_multi' ][ 'awards' ], $show_first = 1 ),
348 ),
349
350 /*
351 * See https://schema.org/citation.
352 *
353 * There is very little information available from Google about the expected JSON markup structure
354 * for citations - the only information available is from the the Google's Dataset type
355 * documentation.
356 *
357 * See https://developers.google.com/search/docs/appearance/structured-data/dataset.
358 */
359 'schema_citation' => array(
360 'tr_class' => $args[ 'tr_class_schema' ][ 'creative.work' ],
361 'th_class' => 'medium',
362 'label' => _x( 'Reference Citations', 'option label', 'wpsso' ),
363 'tooltip' => 'meta-schema_citation',
364 'content' => $form->get_textarea_multi( 'schema_citation', $css_class = 'wide', $css_id = '',
365 $max_len = 0, $args[ 'max_multi' ][ 'citations' ], $show_first = 1 ),
366 ),
367 );
368
369 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
370 }
371
372 /*
373 * Schema CreativeWork > Article.
374 */
375 public function filter_mb_sso_edit_schema_article_rows( $table_rows, $form, $head_info, $mod, $args ) {
376
377 $article_sections = $this->p->util->get_article_sections();
378 $def_reading_mins = $this->p->page->get_reading_mins( $mod );
379
380 $form_rows = array(
381 'subsection_schema_article' => array(
382 'tr_class' => $args[ 'tr_class_schema' ][ 'article' ],
383 'td_class' => 'subsection',
384 'header' => 'h5',
385 'label' => _x( 'Article Information', 'metabox title', 'wpsso' )
386 ),
387 'schema_article_section' => array(
388 'tr_class' => $args[ 'tr_class_schema' ][ 'article' ],
389 'th_class' => 'medium',
390 'label' => _x( 'Article Section', 'option label', 'wpsso' ),
391 'tooltip' => 'meta-schema_article_section',
392 'content' => $form->get_select( 'schema_article_section', $article_sections, $css_class = 'article_section', $css_id = '',
393 $is_assoc = true, $is_disabled = false, $selected = false,
394 $event_names = array( 'on_focus_load_json' ),
395 $event_args = array(
396 'json_var' => 'article_sections',
397 'exp_secs' => WPSSO_CACHE_SELECT_JSON_EXP_SECS, // Create and read from a javascript URL.
398 'is_transl' => true, // No label translation required.
399 'is_sorted' => true, // No label sorting required.
400 )
401 ),
402 ),
403 'schema_reading_mins' => array(
404 'tr_class' => $args[ 'tr_class_schema' ][ 'article' ],
405 'th_class' => 'medium',
406 'label' => _x( 'Est. Reading Time', 'option label', 'wpsso' ),
407 'tooltip' => 'meta-schema_reading_mins',
408 'content' => $form->get_input( 'schema_reading_mins', $css_class = 'xshort', $css_id = '', 0, $def_reading_mins ) . ' ' .
409 __( 'minute(s)', 'wpsso' ),
410 ),
411
412 );
413
414 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
415 }
416
417 /*
418 * Schema CreativeWork > Book.
419 */
420 public function filter_mb_sso_edit_schema_book_rows( $table_rows, $form, $head_info, $mod, $args ) {
421
422 $currencies = SucomUtil::get_currencies_abbrev();
423
424 $form_rows = array(
425 'subsection_schema_book' => array(
426 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
427 'td_class' => 'subsection',
428 'header' => 'h5',
429 'label' => _x( 'Book Information', 'metabox title', 'wpsso' )
430 ),
431 'schema_book_author_type' => array(
432 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
433 'th_class' => 'medium',
434 'label' => _x( 'Book Author Type', 'option label', 'wpsso' ),
435 'tooltip' => 'meta-schema_book_author_type',
436 'content' => $form->get_select( 'schema_book_author_type', $this->p->cf[ 'form' ][ 'author_types' ] ),
437 ),
438 'schema_book_author_name' => array(
439 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
440 'th_class' => 'medium',
441 'label' => _x( 'Book Author Name', 'option label', 'wpsso' ),
442 'tooltip' => 'meta-schema_book_author_name',
443 'content' => $form->get_input( 'schema_book_author_name', $css_class = 'wide' ),
444 ),
445 'schema_book_author_url' => array(
446 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
447 'th_class' => 'medium',
448 'label' => _x( 'Book Author URL', 'option label', 'wpsso' ),
449 'tooltip' => 'meta-schema_book_author_url',
450 'content' => $form->get_input( 'schema_book_author_url', $css_class = 'wide' ),
451 ),
452 'schema_book_pub' => array(
453 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
454 'th_class' => 'medium',
455 'label' => _x( 'Book Published Date', 'option label', 'wpsso' ),
456 'tooltip' => 'meta-schema_book_pub',
457 'content' => $form->get_date_time_timezone( 'schema_book_pub' ),
458 ),
459 'schema_book_created' => array(
460 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
461 'th_class' => 'medium',
462 'label' => _x( 'Book Created Date', 'option label', 'wpsso' ),
463 'tooltip' => 'meta-schema_book_created',
464 'content' => $form->get_date_time_timezone( 'schema_book_created' ),
465 ),
466 'schema_book_edition' => array(
467 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
468 'th_class' => 'medium',
469 'label' => _x( 'Book Edition', 'option label', 'wpsso' ),
470 'tooltip' => 'meta-schema_book_edition',
471 'content' => $form->get_input( 'schema_book_edition' ),
472 ),
473 'schema_book_format' => array(
474 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
475 'th_class' => 'medium',
476 'label' => _x( 'Book Format', 'option label', 'wpsso' ),
477 'tooltip' => 'meta-schema_book_format',
478 'content' => $form->get_select( 'schema_book_format', $this->p->cf[ 'form' ][ 'book_format' ],
479 $css_class = '', $css_id = '', $is_assoc = true ),
480 ),
481 'schema_book_pages' => array(
482 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
483 'th_class' => 'medium',
484 'label' => _x( 'Book Pages', 'option label', 'wpsso' ),
485 'tooltip' => 'meta-schema_book_pages',
486 'content' => $form->get_input( 'schema_book_pages', $css_class = 'short' ),
487 ),
488 'schema_book_isbn' => array( // Open Graph meta tag book:isbn.
489 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
490 'th_class' => 'medium',
491 'label' => _x( 'Book ISBN', 'option label', 'wpsso' ),
492 'tooltip' => 'meta-schema_book_isbn',
493 'content' => $form->get_input( 'schema_book_isbn',
494 $css_class = '', $css_id = '', array( 'min' => 10, 'max' => 13 ) ),
495 ),
496 'schema_book_offers' => array(
497 'tr_class' => $args[ 'tr_class_schema' ][ 'book' ],
498 'th_class' => 'medium',
499 'label' => _x( 'Book Offers', 'option label', 'wpsso' ),
500 'tooltip' => 'meta-schema_book_offers',
501 'content' => $form->get_mixed_multi( array(
502 'schema_book_offer_name' => array(
503 'input_title' => _x( 'Book Offer Name', 'option label', 'wpsso' ),
504 'input_type' => 'text',
505 'input_class' => 'offer_name',
506 ),
507 'schema_book_offer_price' => array(
508 'input_title' => _x( 'Book Offer Price', 'option label', 'wpsso' ),
509 'input_type' => 'text',
510 'input_class' => 'price',
511 ),
512 'schema_book_offer_currency' => array(
513 'input_title' => _x( 'Book Offer Currency', 'option label', 'wpsso' ),
514 'input_type' => 'select',
515 'input_class' => 'currency',
516 'select_options' => $currencies,
517 'select_default' => $this->p->options[ 'og_def_currency' ],
518 'event_names' => array( 'on_focus_load_json' ),
519 'event_args' => array( 'json_var' => 'currencies' ),
520 ),
521 'schema_book_offer_avail' => array(
522 'input_title' => _x( 'Book Offer Availability', 'option label', 'wpsso' ),
523 'input_type' => 'select',
524 'input_class' => 'stock',
525 'select_options' => $this->p->cf[ 'form' ][ 'item_availability' ],
526 'select_default' => 'https://schema.org/InStock',
527 ),
528 ), $css_class = 'single_line', $css_id = 'schema_book_offer', $args[ 'max_multi' ][ 'metadata_offers' ], $show_first = 2 ),
529 ),
530
531 /*
532 * Schema CreativeWork > Book > Audiobook.
533 */
534 'subsection_schema_book_audio' => array(
535 'tr_class' => $args[ 'tr_class_schema' ][ 'book.audio' ],
536 'td_class' => 'subsection',
537 'header' => 'h5',
538 'label' => _x( 'Audiobook Information', 'metabox title', 'wpsso' )
539 ),
540 'schema_book_audio_duration_time' => array(
541 'tr_class' => $args[ 'tr_class_schema' ][ 'book.audio' ],
542 'th_class' => 'medium',
543 'label' => _x( 'Audiobook Duration', 'option label', 'wpsso' ),
544 'tooltip' => 'meta-schema_book_audio_duration_time',
545 'content' => $form->get_input_time_dhms( 'schema_book_audio_duration' ),
546 ),
547 );
548
549 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
550 }
551
552 /*
553 * Schema CreativeWork > HowTo.
554 */
555 public function filter_mb_sso_edit_schema_howto_rows( $table_rows, $form, $head_info, $mod, $args ) {
556
557 $form_rows = array(
558 'subsection_schema_howto' => array(
559 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
560 'td_class' => 'subsection',
561 'header' => 'h5',
562 'label' => _x( 'How-To Information', 'metabox title', 'wpsso' )
563 ),
564 'schema_howto_yield' => array(
565 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
566 'th_class' => 'medium',
567 'label' => _x( 'How-To Makes', 'option label', 'wpsso' ),
568 'tooltip' => 'meta-schema_howto_yield',
569 'content' => $form->get_input( 'schema_howto_yield', $css_class = 'wide' ),
570 ),
571 'schema_howto_prep_time' => array(
572 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
573 'th_class' => 'medium',
574 'label' => _x( 'Preparation Time', 'option label', 'wpsso' ),
575 'tooltip' => 'meta-schema_howto_prep_time',
576 'content' => $form->get_input_time_dhms( 'schema_howto_prep' ),
577 ),
578 'schema_howto_total_time' => array(
579 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
580 'th_class' => 'medium',
581 'label' => _x( 'Total Time', 'option label', 'wpsso' ),
582 'tooltip' => 'meta-schema_howto_total_time',
583 'content' => $form->get_input_time_dhms( 'schema_howto_total' ),
584 ),
585 'schema_howto_supplies' => array(
586 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
587 'th_class' => 'medium',
588 'label' => _x( 'How-To Supplies', 'option label', 'wpsso' ),
589 'tooltip' => 'meta-schema_howto_supplies',
590 'content' => $form->get_input_multi( 'schema_howto_supply', $css_class = 'wide', $css_id = '',
591 $args[ 'max_multi' ][ 'howto_supplies' ], $show_first = 5 ),
592 ),
593 'schema_howto_tools' => array(
594 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
595 'th_class' => 'medium',
596 'label' => _x( 'How-To Tools', 'option label', 'wpsso' ),
597 'tooltip' => 'meta-schema_howto_tools',
598 'content' => $form->get_input_multi( 'schema_howto_tool', $css_class = 'wide', $css_id = '',
599 $args[ 'max_multi' ][ 'howto_tools' ], $show_first = 5 ),
600 ),
601 'schema_howto_steps' => array(
602 'tr_class' => $args[ 'tr_class_schema' ][ 'howto' ],
603 'th_class' => 'medium',
604 'label' => _x( 'How-To Steps', 'option label', 'wpsso' ),
605 'tooltip' => 'meta-schema_howto_steps',
606 'content' => $form->get_mixed_multi( array(
607 'schema_howto_step_section' => array(
608 'input_type' => 'radio',
609 'input_class' => 'howto_step_section',
610 'input_content' => _x( 'How-To %1$s step or %2$s section of steps:', 'option label', 'wpsso' ),
611 'input_values' => array( 0, 1 ),
612 'input_default' => 0,
613 ),
614 'schema_howto_step' => array(
615 'input_label' => _x( 'Name', 'option label', 'wpsso' ),
616 'input_type' => 'text',
617 'input_class' => 'wide howto_step_name',
618 ),
619 'schema_howto_step_text' => array(
620 'input_label' => _x( 'Description', 'option label', 'wpsso' ),
621 'input_type' => 'textarea',
622 'input_class' => 'wide howto_step_text',
623 ),
624 'schema_howto_step_anchor_id' => array(
625 'input_label' => _x( 'Anchor ID', 'option label', 'wpsso' ),
626 'input_type' => 'text',
627 'input_class' => 'css_id howto_step_anchor_id',
628 ),
629 'schema_howto_step_img' => array(
630 'input_label' => _x( 'Image ID', 'option label', 'wpsso' ),
631 'input_type' => 'image',
632 'input_class' => 'howto_step_img',
633 ),
634 ), $css_class = '', $css_id = 'schema_howto_steps', $args[ 'max_multi' ][ 'howto_steps' ], $show_first = 2 ),
635 ),
636 );
637
638 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
639 }
640
641 /*
642 * Schema CreativeWork > HowTo > Recipe.
643 */
644 public function filter_mb_sso_edit_schema_recipe_rows( $table_rows, $form, $head_info, $mod, $args ) {
645
646 $form_rows = array(
647 'subsection_schema_recipe' => array(
648 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
649 'td_class' => 'subsection',
650 'header' => 'h5',
651 'label' => _x( 'Recipe Information', 'metabox title', 'wpsso' )
652 ),
653 'schema_recipe_cuisine' => array(
654 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
655 'th_class' => 'medium',
656 'label' => _x( 'Recipe Cuisine', 'option label', 'wpsso' ),
657 'tooltip' => 'meta-schema_recipe_cuisine',
658 'content' => $form->get_input( 'schema_recipe_cuisine', $css_class = 'wide' ),
659 ),
660 'schema_recipe_course' => array(
661 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
662 'th_class' => 'medium',
663 'label' => _x( 'Recipe Course', 'option label', 'wpsso' ),
664 'tooltip' => 'meta-schema_recipe_course',
665 'content' => $form->get_input( 'schema_recipe_course', $css_class = 'wide' ),
666 ),
667 'schema_recipe_yield' => array(
668 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
669 'th_class' => 'medium',
670 'label' => _x( 'Recipe Makes', 'option label', 'wpsso' ),
671 'tooltip' => 'meta-schema_recipe_yield',
672 'content' => $form->get_input( 'schema_recipe_yield', $css_class = 'wide' ),
673 ),
674 'schema_recipe_cook_method' => array(
675 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
676 'th_class' => 'medium',
677 'label' => _x( 'Cooking Method', 'option label', 'wpsso' ),
678 'tooltip' => 'meta-schema_recipe_cook_method',
679 'content' => $form->get_input( 'schema_recipe_cook_method', $css_class = 'wide' ),
680 ),
681 'schema_recipe_prep_time' => array(
682 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
683 'th_class' => 'medium',
684 'label' => _x( 'Preparation Time', 'option label', 'wpsso' ),
685 'tooltip' => 'meta-schema_recipe_prep_time',
686 'content' => $form->get_input_time_dhms( 'schema_recipe_prep' ),
687 ),
688 'schema_recipe_cook_time' => array(
689 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
690 'th_class' => 'medium',
691 'label' => _x( 'Cooking Time', 'option label', 'wpsso' ),
692 'tooltip' => 'meta-schema_recipe_cook_time',
693 'content' => $form->get_input_time_dhms( 'schema_recipe_cook' ),
694 ),
695 'schema_recipe_total_time' => array(
696 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
697 'th_class' => 'medium',
698 'label' => _x( 'Total Time', 'option label', 'wpsso' ),
699 'tooltip' => 'meta-schema_recipe_total_time',
700 'content' => $form->get_input_time_dhms( 'schema_recipe_total' ),
701 ),
702 'schema_recipe_ingredients' => array(
703 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
704 'th_class' => 'medium',
705 'label' => _x( 'Recipe Ingredients', 'option label', 'wpsso' ),
706 'tooltip' => 'meta-schema_recipe_ingredients',
707 'content' => $form->get_input_multi( 'schema_recipe_ingredient', $css_class = 'wide', $css_id = '',
708 $args[ 'max_multi' ][ 'recipe_ingr' ], $show_first = 5 ),
709 ),
710 'schema_recipe_instructions' => array(
711 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
712 'th_class' => 'medium',
713 'label' => _x( 'Recipe Instructions', 'option label', 'wpsso' ),
714 'tooltip' => 'meta-schema_recipe_instructions',
715 'content' => $form->get_mixed_multi( array(
716 'schema_recipe_instruction_section' => array(
717 'input_type' => 'radio',
718 'input_class' => 'recipe_instruction_section',
719 'input_content' => _x( 'Recipe %1$s instruction or %2$s section of instructions:', 'option label', 'wpsso' ),
720 'input_values' => array( 0, 1 ),
721 'input_default' => 0,
722 ),
723 'schema_recipe_instruction' => array(
724 'input_label' => _x( 'Name', 'option label', 'wpsso' ),
725 'input_type' => 'text',
726 'input_class' => 'wide recipe_instruction_name',
727 ),
728 'schema_recipe_instruction_text' => array(
729 'input_label' => _x( 'Description', 'option label', 'wpsso' ),
730 'input_type' => 'textarea',
731 'input_class' => 'wide recipe_instruction_text',
732 ),
733 'schema_recipe_instruction_anchor_id' => array(
734 'input_label' => _x( 'Anchor ID', 'option label', 'wpsso' ),
735 'input_type' => 'text',
736 'input_class' => 'css_id recipe_instruction_anchor_id',
737 ),
738 'schema_recipe_instruction_img' => array(
739 'input_label' => _x( 'Image ID', 'option label', 'wpsso' ),
740 'input_type' => 'image',
741 'input_class' => 'recipe_instruction_img',
742 ),
743 ), $css_class = '', $css_id = 'schema_recipe_instructions', $args[ 'max_multi' ][ 'recipe_inst' ], $show_first = 2 ),
744 ),
745
746 /*
747 * Recipe Nutrition Information.
748 */
749 'subsection_schema_recipe_nutrition' => array(
750 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
751 'td_class' => 'subsection',
752 'header' => 'h5',
753 'label' => _x( 'Recipe Nutrition Information', 'metabox title', 'wpsso' )
754 ),
755 'schema_recipe_nutri_serv' => array(
756 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
757 'th_class' => 'medium',
758 'label' => _x( 'Serving Size', 'option label', 'wpsso' ),
759 'tooltip' => 'meta-schema_recipe_nutri_serv',
760 'content' => $form->get_input( 'schema_recipe_nutri_serv', $css_class = 'wide' ),
761 ),
762 'schema_recipe_nutri_cal' => array(
763 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
764 'th_class' => 'medium',
765 'label' => _x( 'Calories', 'option label', 'wpsso' ),
766 'tooltip' => 'meta-schema_recipe_nutri_cal',
767 'content' => $form->get_input( 'schema_recipe_nutri_cal', 'medium' ) . ' ' .
768 _x( 'calories', 'option comment', 'wpsso' ),
769 ),
770 'schema_recipe_nutri_prot' => array(
771 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
772 'th_class' => 'medium',
773 'label' => _x( 'Protein', 'option label', 'wpsso' ),
774 'tooltip' => 'meta-schema_recipe_nutri_prot',
775 'content' => $form->get_input( 'schema_recipe_nutri_prot', 'medium' ) . ' ' .
776 _x( 'grams of protein', 'option comment', 'wpsso' ),
777 ),
778 'schema_recipe_nutri_fib' => array(
779 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
780 'th_class' => 'medium',
781 'label' => _x( 'Fiber', 'option label', 'wpsso' ),
782 'tooltip' => 'meta-schema_recipe_nutri_fib',
783 'content' => $form->get_input( 'schema_recipe_nutri_fib', 'medium' ) . ' ' .
784 _x( 'grams of fiber', 'option comment', 'wpsso' ),
785 ),
786 'schema_recipe_nutri_carb' => array(
787 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
788 'th_class' => 'medium',
789 'label' => _x( 'Carbohydrates', 'option label', 'wpsso' ),
790 'tooltip' => 'meta-schema_recipe_nutri_carb',
791 'content' => $form->get_input( 'schema_recipe_nutri_carb', 'medium' ) . ' ' .
792 _x( 'grams of carbohydrates', 'option comment', 'wpsso' ),
793 ),
794 'schema_recipe_nutri_sugar' => array(
795 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
796 'th_class' => 'medium',
797 'label' => _x( 'Sugar', 'option label', 'wpsso' ),
798 'tooltip' => 'meta-schema_recipe_nutri_sugar',
799 'content' => $form->get_input( 'schema_recipe_nutri_sugar', 'medium' ) . ' ' .
800 _x( 'grams of sugar', 'option comment', 'wpsso' ),
801 ),
802 'schema_recipe_nutri_sod' => array(
803 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
804 'th_class' => 'medium',
805 'label' => _x( 'Sodium', 'option label', 'wpsso' ),
806 'tooltip' => 'meta-schema_recipe_nutri_sod',
807 'content' => $form->get_input( 'schema_recipe_nutri_sod', 'medium' ) . ' ' .
808 _x( 'milligrams of sodium', 'option comment', 'wpsso' ),
809 ),
810 'schema_recipe_nutri_fat' => array(
811 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
812 'th_class' => 'medium',
813 'label' => _x( 'Fat', 'option label', 'wpsso' ),
814 'tooltip' => 'meta-schema_recipe_nutri_fat',
815 'content' => $form->get_input( 'schema_recipe_nutri_fat', 'medium' ) . ' ' .
816 _x( 'grams of fat', 'option comment', 'wpsso' ),
817 ),
818 'schema_recipe_nutri_sat_fat' => array(
819 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
820 'th_class' => 'medium',
821 'label' => _x( 'Saturated Fat', 'option label', 'wpsso' ),
822 'tooltip' => 'meta-schema_recipe_nutri_sat_fat',
823 'content' => $form->get_input( 'schema_recipe_nutri_sat_fat', 'medium' ) . ' ' .
824 _x( 'grams of saturated fat', 'option comment', 'wpsso' ),
825 ),
826 'schema_recipe_nutri_unsat_fat' => array(
827 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
828 'th_class' => 'medium',
829 'label' => _x( 'Unsaturated Fat', 'option label', 'wpsso' ),
830 'tooltip' => 'meta-schema_recipe_nutri_unsat_fat',
831 'content' => $form->get_input( 'schema_recipe_nutri_unsat_fat', 'medium' ) . ' ' .
832 _x( 'grams of unsaturated fat', 'option comment', 'wpsso' ),
833 ),
834 'schema_recipe_nutri_trans_fat' => array(
835 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
836 'th_class' => 'medium',
837 'label' => _x( 'Trans Fat', 'option label', 'wpsso' ),
838 'tooltip' => 'meta-schema_recipe_nutri_trans_fat',
839 'content' => $form->get_input( 'schema_recipe_nutri_trans_fat', 'medium' ) . ' ' .
840 _x( 'grams of trans fat', 'option comment', 'wpsso' ),
841 ),
842 'schema_recipe_nutri_chol' => array(
843 'tr_class' => $args[ 'tr_class_schema' ][ 'recipe' ],
844 'th_class' => 'medium',
845 'label' => _x( 'Cholesterol', 'option label', 'wpsso' ),
846 'tooltip' => 'meta-schema_recipe_nutri_chol',
847 'content' => $form->get_input( 'schema_recipe_nutri_chol', 'medium' ) . ' ' .
848 _x( 'milligrams of cholesterol', 'option comment', 'wpsso' ),
849 ),
850 );
851
852 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
853 }
854
855 /*
856 * Schema CreativeWork > LearningResource.
857 *
858 * See https://developers.google.com/search/docs/appearance/structured-data/learning-video#learning-video-[videoobject,-learningresource].
859 */
860 public function filter_mb_sso_edit_schema_learningresource_rows( $table_rows, $form, $head_info, $mod, $args ) {
861
862 $form_rows = array(
863 'subsection_schema_learnres' => array(
864 'tr_class' => $args[ 'tr_class_schema' ][ 'learning.resource' ],
865 'td_class' => 'subsection',
866 'header' => 'h5',
867 'label' => _x( 'Learning Resource Information', 'metabox title', 'wpsso' )
868 ),
869 'schema_learnres_educational_level' => array(
870 'tr_class' => $args[ 'tr_class_schema' ][ 'learning.resource' ],
871 'th_class' => 'medium',
872 'label' => _x( 'Educational Level', 'option label', 'wpsso' ),
873 'tooltip' => 'meta-schema_learnres_educational_level',
874 'content' => $form->get_select_education_level( 'schema_learnres_educational_level', 'wide' ),
875 ),
876 'schema_learnres_resource_type' => array(
877 'tr_class' => $args[ 'tr_class_schema' ][ 'learning.resource' ],
878 'th_class' => 'medium',
879 'label' => _x( 'Resource Type', 'option label', 'wpsso' ),
880 'tooltip' => 'meta-schema_learnres_resource_type',
881 'content' => $form->get_input( 'schema_learnres_resource_type', 'wide' ),
882 ),
883 );
884
885 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
886 }
887
888 /*
889 * Schema CreativeWork > Movie.
890 */
891 public function filter_mb_sso_edit_schema_movie_rows( $table_rows, $form, $head_info, $mod, $args ) {
892
893 $form_rows = array(
894 'subsection_schema_movie' => array(
895 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
896 'td_class' => 'subsection',
897 'header' => 'h5',
898 'label' => _x( 'Movie Information', 'metabox title', 'wpsso' )
899 ),
900 'schema_movie_actor_person_names' => array(
901 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
902 'th_class' => 'medium',
903 'label' => _x( 'Movie Cast Names', 'option label', 'wpsso' ),
904 'tooltip' => 'meta-schema_movie_actor_person_names',
905 'content' => $form->get_input_multi( 'schema_movie_actor_person_name', // Singular.
906 $css_class = 'long_name', $css_id = '', $args[ 'max_multi' ][ 'movie_actors' ], $show_first = 3 ),
907 ),
908 'schema_movie_director_person_names' => array(
909 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
910 'th_class' => 'medium',
911 'label' => _x( 'Movie Director Names', 'option label', 'wpsso' ),
912 'tooltip' => 'meta-schema_movie_director_person_names',
913 'content' => $form->get_input_multi( 'schema_movie_director_person_name', // Singular.
914 $css_class = 'long_name', $css_id = '', $args[ 'max_multi' ][ 'movie_directors' ], $show_first = 1 ),
915 ),
916 'schema_movie_prodco_org_id' => array(
917 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
918 'th_class' => 'medium',
919 'label' => _x( 'Production Company', 'option label', 'wpsso' ),
920 'tooltip' => 'meta-schema_movie_prodco_org_id',
921 'content' => $form->get_select( 'schema_movie_prodco_org_id', $args[ 'select' ][ 'org' ],
922 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
923 $selected = false, $event_names = array( 'on_focus_load_json' ),
924 $event_args = array( 'json_var' => 'org_names' ) ),
925 ),
926 'schema_movie_released' => array(
927 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
928 'th_class' => 'medium',
929 'label' => _x( 'Movie Release Date', 'option label', 'wpsso' ),
930 'tooltip' => 'meta-schema_movie_released',
931 'content' => $form->get_date_time_timezone( 'schema_movie_released' ),
932 ),
933 'schema_movie_duration_time' => array(
934 'tr_class' => $args[ 'tr_class_schema' ][ 'movie' ],
935 'th_class' => 'medium',
936 'label' => _x( 'Movie Runtime', 'option label', 'wpsso' ),
937 'tooltip' => 'meta-schema_movie_duration_time',
938 'content' => $form->get_input_time_dhms( 'schema_movie_duration' ),
939 ),
940 );
941
942 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
943 }
944
945 /*
946 * Schema CreativeWork > Review.
947 */
948 public function filter_mb_sso_edit_schema_review_rows( $table_rows, $form, $head_info, $mod, $args ) {
949
950 $currencies = SucomUtil::get_currencies_abbrev();
951 $item_type_row_class = WpssoSchema::get_schema_type_row_class( 'schema_review_item_type' );
952
953 $form_rows = array(
954 'subsection_schema_review' => array(
955 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
956 'td_class' => 'subsection',
957 'header' => 'h5',
958 'label' => _x( 'Review Information', 'metabox title', 'wpsso' )
959 ),
960 'schema_review_rating' => array(
961 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
962 'th_class' => 'medium',
963 'label' => _x( 'Review Rating', 'option label', 'wpsso' ),
964 'tooltip' => 'meta-schema_review_rating',
965 'content' => '' .
966 $form->get_input( 'schema_review_rating', $css_class = 'rating', $css_id = '', $max_len = 0, $holder = true ) .
967 ' ' . _x( 'from', 'option comment', 'wpsso' ) . ' ' .
968 $form->get_input( 'schema_review_rating_min', $css_class = 'rating', $css_id = '', $max_len = 0, $holder = true ) .
969 ' ' . _x( 'to', 'option comment', 'wpsso' ) . ' ' .
970 $form->get_input( 'schema_review_rating_max', $css_class = 'rating', $css_id = '', $max_len = 0, $holder = true ),
971 ),
972 'schema_review_rating_alt_name' => array(
973 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
974 'th_class' => 'medium',
975 'label' => _x( 'Rating Alt Name', 'option label', 'wpsso' ),
976 'tooltip' => 'meta-schema_review_rating_alt_name',
977 'content' => $form->get_input( 'schema_review_rating_alt_name' ),
978 ),
979
980 /*
981 * Schema Review Subject Information.
982 *
983 * Note that although the Schema standard allows the subject of a review to be any Schema type,
984 * Google allows reviews for only a few specific Schema types (and their sub-types):
985 *
986 * Book
987 * Course
988 * Event
989 * How-to
990 * Local business
991 * Movie
992 * Product
993 * Recipe
994 * Software App
995 *
996 * See https://developers.google.com/search/docs/data-types/review-snippet.
997 */
998 'subsection_schema_review_item' => array(
999 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1000 'td_class' => 'subsection',
1001 'header' => 'h5',
1002 'label' => _x( 'Review Subject (aka Item Reviewed) Information', 'metabox title', 'wpsso' )
1003 ),
1004 'schema_review_item_name' => array(
1005 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1006 'th_class' => 'medium',
1007 'label' => _x( 'Subject Name', 'option label', 'wpsso' ),
1008 'tooltip' => 'meta-schema_review_item_name',
1009 'content' => $form->get_input( 'schema_review_item_name', $css_class = 'wide' ),
1010 ),
1011 'schema_review_item_desc' => array(
1012 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1013 'th_class' => 'medium',
1014 'label' => _x( 'Subject Description', 'option label', 'wpsso' ),
1015 'tooltip' => 'meta-schema_review_item_desc',
1016 'content' => $form->get_textarea( 'schema_review_item_desc' ),
1017 ),
1018 'schema_review_item_img_id' => array(
1019 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1020 'th_class' => 'medium',
1021 'label' => _x( 'Subject Image ID', 'option label', 'wpsso' ),
1022 'tooltip' => 'meta-schema_review_item_img_id',
1023 'content' => $form->get_input_image_upload( 'schema_review_item_img' ),
1024 ),
1025 'schema_review_item_img_url' => array(
1026 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1027 'th_class' => 'medium',
1028 'label' => _x( 'or an Image URL', 'option label', 'wpsso' ),
1029 'tooltip' => 'meta-schema_review_item_img_url',
1030 'content' => $form->get_input_image_url( 'schema_review_item_img' ),
1031 ),
1032 'schema_review_item_url' => array(
1033 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1034 'th_class' => 'medium',
1035 'label' => _x( 'Subject Webpage URL', 'option label', 'wpsso' ),
1036 'tooltip' => 'meta-schema_review_item_url',
1037 'content' => $form->get_input( 'schema_review_item_url', $css_class = 'wide' ),
1038 ),
1039 'schema_review_item_sameas_url' => array(
1040 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1041 'th_class' => 'medium',
1042 'label' => _x( 'Subject Same-As URLs', 'option label', 'wpsso' ),
1043 'tooltip' => 'meta-schema_review_item_sameas_url',
1044 'content' => $form->get_input_multi( 'schema_review_item_sameas_url', $css_class = 'wide', $css_id = '',
1045 $args[ 'max_multi' ][ 'sameas_url' ], $show_first = 1 ),
1046 ),
1047 'schema_review_item_type' => array(
1048 'tr_class' => $args[ 'tr_class_schema' ][ 'review' ],
1049 'th_class' => 'medium',
1050 'label' => _x( 'Subject Schema Type', 'option label', 'wpsso' ),
1051 'tooltip' => 'meta-schema_review_item_type',
1052 'content' => $form->get_select( 'schema_review_item_type', $args[ 'select' ][ 'schema_types' ],
1053 $css_class = 'schema_type', $css_id = '', $is_assoc = true, $is_disabled = false, $selected = false,
1054 $event_names = array( 'on_focus_load_json', 'on_show_unhide_rows' ),
1055 $event_args = array(
1056 'json_var' => 'schema_types',
1057 'exp_secs' => WPSSO_CACHE_SELECT_JSON_EXP_SECS, // Create and read from a javascript URL.
1058 'is_transl' => true, // No label translation required.
1059 'is_sorted' => true, // No label sorting required.
1060 ) ),
1061 ),
1062
1063 /*
1064 * Schema Review Subject: CreativeWork.
1065 */
1066 'schema_review_item_cw_author_type' => array(
1067 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'creative.work' ],
1068 'th_class' => 'medium',
1069 'label' => _x( 'Subject Author Type', 'option label', 'wpsso' ),
1070 'tooltip' => 'meta-schema_review_item_cw_author_type',
1071 'content' => $form->get_select( 'schema_review_item_cw_author_type', $this->p->cf[ 'form' ][ 'author_types' ] ),
1072 ),
1073 'schema_review_item_cw_author_name' => array(
1074 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'creative.work' ],
1075 'th_class' => 'medium',
1076 'label' => _x( 'Subject Author Name', 'option label', 'wpsso' ),
1077 'tooltip' => 'meta-schema_review_item_cw_author_name',
1078 'content' => $form->get_input( 'schema_review_item_cw_author_name', $css_class = 'wide' ),
1079 ),
1080 'schema_review_item_cw_author_url' => array(
1081 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'creative.work' ],
1082 'th_class' => 'medium',
1083 'label' => _x( 'Subject Author URL', 'option label', 'wpsso' ),
1084 'tooltip' => 'meta-schema_review_item_cw_author_url',
1085 'content' => $form->get_input( 'schema_review_item_cw_author_url', $css_class = 'wide' ),
1086 ),
1087 'schema_review_item_cw_pub' => array(
1088 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'creative.work' ],
1089 'th_class' => 'medium',
1090 'label' => _x( 'Subject Published Date', 'option label', 'wpsso' ),
1091 'tooltip' => 'meta-schema_review_item_cw_pub',
1092 'content' => $form->get_date_time_timezone( 'schema_review_item_cw_pub' ),
1093 ),
1094 'schema_review_item_cw_created' => array(
1095 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'creative.work' ],
1096 'th_class' => 'medium',
1097 'label' => _x( 'Subject Created Date', 'option label', 'wpsso' ),
1098 'tooltip' => 'meta-schema_review_item_cw_created',
1099 'content' => $form->get_date_time_timezone( 'schema_review_item_cw_created' ),
1100 ),
1101
1102 /*
1103 * Schema Review Subject: CreativeWork > Book.
1104 */
1105 'schema_review_item_cw_book_isbn' => array(
1106 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'book' ],
1107 'th_class' => 'medium',
1108 'label' => _x( 'Subject Book ISBN', 'option label', 'wpsso' ),
1109 'tooltip' => 'meta-schema_review_item_cw_book_isbn',
1110 'content' => $form->get_input( 'schema_review_item_cw_book_isbn',
1111 $css_class = '', $css_id = '', $len = array( 'min' => 10, 'max' => 13 ) ),
1112 ),
1113
1114 /*
1115 * Schema Review Subject: CreativeWork > Movie.
1116 */
1117 'schema_review_item_cw_movie_actor_person_names' => array(
1118 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'movie' ],
1119 'th_class' => 'medium',
1120 'label' => _x( 'Movie Cast Names', 'option label', 'wpsso' ),
1121 'tooltip' => 'meta-schema_review_item_cw_movie_actor_person_names',
1122 'content' => $form->get_input_multi( 'schema_review_item_cw_movie_actor_person_name', // Singular.
1123 $css_class = 'long_name', $css_id = '', $args[ 'max_multi' ][ 'movie_actors' ], $show_first = 3 ),
1124 ),
1125 'schema_review_item_cw_movie_director_person_names' => array(
1126 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'movie' ],
1127 'th_class' => 'medium',
1128 'label' => _x( 'Movie Director Names', 'option label', 'wpsso' ),
1129 'tooltip' => 'meta-schema_review_item_cw_movie_director_person_names',
1130 'content' => $form->get_input_multi( 'schema_review_item_cw_movie_director_person_name', // Singular.
1131 $css_class = 'long_name', $css_num = '', $args[ 'max_multi' ][ 'movie_directors' ], $show_first = 1 ),
1132 ),
1133
1134 /*
1135 * Schema Review Subject: CreativeWork > SoftwareApplication.
1136 */
1137 'schema_review_item_software_app_cat' => array(
1138 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'software.application' ],
1139 'th_class' => 'medium',
1140 'label' => _x( 'Application Category', 'option label', 'wpsso' ),
1141 'tooltip' => 'meta-schema_review_item_software_app_cat',
1142 'content' => $form->get_input( 'schema_review_item_software_app_cat', $css_class = 'wide' ),
1143 ),
1144 'schema_review_item_software_app_os' => array(
1145 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'software.application' ],
1146 'th_class' => 'medium',
1147 'label' => _x( 'Operating System', 'option label', 'wpsso' ),
1148 'tooltip' => 'meta-schema_review_item_software_app_os',
1149 'content' => $form->get_input( 'schema_review_item_software_app_os', $css_class = 'wide' ),
1150 ),
1151 'schema_review_item_software_app_dl_url' => array(
1152 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'software.application' ],
1153 'th_class' => 'medium',
1154 'label' => _x( 'Download URL', 'option label', 'wpsso' ),
1155 'tooltip' => 'meta-schema_review_item_software_app_dl_url',
1156 'content' => $form->get_input( 'schema_review_item_software_app_dl_url', $css_class = 'wide' ),
1157 ),
1158 'schema_review_item_software_app_offers' => array(
1159 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'software.application' ],
1160 'th_class' => 'medium',
1161 'label' => _x( 'Software App Offers', 'option label', 'wpsso' ),
1162 'tooltip' => 'meta-schema_review_item_software_app_offers',
1163 'content' => $form->get_mixed_multi( array(
1164 'schema_review_item_software_app_offer_name' => array(
1165 'input_title' => _x( 'Software App Offer Name', 'option label', 'wpsso' ),
1166 'input_type' => 'text',
1167 'input_class' => 'offer_name',
1168 ),
1169 'schema_review_item_software_app_offer_price' => array(
1170 'input_title' => _x( 'Software App Offer Price', 'option label', 'wpsso' ),
1171 'input_type' => 'text',
1172 'input_class' => 'price',
1173 ),
1174 'schema_review_item_software_app_offer_currency' => array(
1175 'input_title' => _x( 'Software App Offer Currency', 'option label', 'wpsso' ),
1176 'input_type' => 'select',
1177 'input_class' => 'currency',
1178 'select_options' => $currencies,
1179 'select_default' => $this->p->options[ 'og_def_currency' ],
1180 'event_names' => array( 'on_focus_load_json' ),
1181 'event_args' => array( 'json_var' => 'currencies' ),
1182 ),
1183 'schema_review_item_software_app_offer_avail' => array(
1184 'input_title' => _x( 'Software App Offer Availability', 'option label', 'wpsso' ),
1185 'input_type' => 'select',
1186 'input_class' => 'stock',
1187 'select_options' => $this->p->cf[ 'form' ][ 'item_availability' ],
1188 'select_default' => 'https://schema.org/InStock',
1189 ),
1190 ), $css_class = 'single_line', $css_id = 'schema_review_item_software_app_offer',
1191 $args[ 'max_multi' ][ 'metadata_offers' ], $show_first = 2 ),
1192 ),
1193
1194 /*
1195 * Schema Review Subject: Place.
1196 */
1197 'schema_review_item_place_phone' => array(
1198 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1199 'th_class' => 'medium',
1200 'label' => _x( 'Subject Telephone', 'option label', 'wpsso' ),
1201 'tooltip' => 'meta-place_phone',
1202 'content' => $form->get_input( 'schema_review_item_place_phone' ),
1203 ),
1204 'schema_review_item_place_street_address' => array(
1205 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1206 'th_class' => 'medium',
1207 'label' =>_x( 'Subject Street Address', 'option label', 'wpsso' ),
1208 'tooltip' => 'meta-place_street_address',
1209 'content' => $form->get_input( 'schema_review_item_place_street_address', 'wide' ),
1210 ),
1211 'schema_review_item_place_po_box_number' => array(
1212 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1213 'th_class' => 'medium',
1214 'label' => _x( 'Subject P.O. Box Number', 'option label', 'wpsso' ),
1215 'tooltip' => 'meta-place_po_box_number',
1216 'content' => $form->get_input( 'schema_review_item_place_po_box_number' ),
1217 ),
1218 'schema_review_item_place_city' => array(
1219 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1220 'th_class' => 'medium',
1221 'label' => _x( 'Subject City / Locality', 'option label', 'wpsso' ),
1222 'tooltip' => 'meta-place_city',
1223 'content' => $form->get_input( 'schema_review_item_place_city' ),
1224 ),
1225 'schema_review_item_place_region' => array(
1226 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1227 'th_class' => 'medium',
1228 'label' => _x( 'Subject State / Province', 'option label', 'wpsso' ),
1229 'tooltip' => 'meta-place_region',
1230 'content' => $form->get_input( 'schema_review_item_place_region' ),
1231 ),
1232 'schema_review_item_place_postal_code' => array(
1233 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1234 'th_class' => 'medium',
1235 'label' => _x( 'Subject Zip / Postal Code', 'option label', 'wpsso' ),
1236 'tooltip' => 'meta-place_postal_code',
1237 'content' => $form->get_input( 'schema_review_item_place_postal_code' ),
1238 ),
1239 'schema_review_item_place_country' => array(
1240 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'place' ],
1241 'th_class' => 'medium',
1242 'label' => _x( 'Subject Country', 'option label', 'wpsso' ),
1243 'tooltip' => 'meta-place_country',
1244 'content' => $form->get_select_country( 'schema_review_item_place_country' ),
1245 ),
1246
1247 /*
1248 * Schema Review Subject: Place > LocalBusiness.
1249 */
1250 'schema_review_item_place_price_range' => array(
1251 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'local.business' ],
1252 'th_class' => 'medium',
1253 'label' => _x( 'Subject Price Range', 'option label', 'wpsso' ),
1254 'tooltip' => 'meta-place_price_range',
1255 'content' => $form->get_input( 'schema_review_item_place_price_range' ),
1256 ),
1257
1258 /*
1259 * Schema Review Subject: Place > LocalBusiness > FoodEstablishment.
1260 */
1261 'schema_review_item_place_cuisine' => array(
1262 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'food.establishment' ],
1263 'th_class' => 'medium',
1264 'label' => _x( 'Subject Serves Cuisine', 'option label', 'wpsso' ),
1265 'tooltip' => 'meta-place_cuisine',
1266 'content' => $form->get_input( 'schema_review_item_place_cuisine' ),
1267 ),
1268
1269 /*
1270 * Schema Review Subject: Product.
1271 */
1272 'schema_review_item_product_brand' => array(
1273 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'product' ],
1274 'th_class' => 'medium',
1275 'label' => _x( 'Subject Product Brand', 'option label', 'wpsso' ),
1276 'tooltip' => 'meta-schema_review_item_product_brand',
1277 'content' => $form->get_input( 'schema_review_item_product_brand', $css_class = 'wide' ),
1278 ),
1279 'schema_review_item_product_offers' => array(
1280 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'product' ],
1281 'th_class' => 'medium',
1282 'label' => _x( 'Subject Product Offers', 'option label', 'wpsso' ),
1283 'tooltip' => 'meta-schema_review_item_product_offers',
1284 'content' => $form->get_mixed_multi( array(
1285 'schema_review_item_product_offer_name' => array(
1286 'input_title' => _x( 'Product Offer Name', 'option label', 'wpsso' ),
1287 'input_type' => 'text',
1288 'input_class' => 'offer_name',
1289 ),
1290 'schema_review_item_product_offer_price' => array(
1291 'input_title' => _x( 'Product Offer Price', 'option label', 'wpsso' ),
1292 'input_type' => 'text',
1293 'input_class' => 'price',
1294 ),
1295 'schema_review_item_product_offer_currency' => array(
1296 'input_title' => _x( 'Product Offer Currency', 'option label', 'wpsso' ),
1297 'input_type' => 'select',
1298 'input_class' => 'currency',
1299 'select_options' => $currencies,
1300 'select_default' => $this->p->options[ 'og_def_currency' ],
1301 'event_names' => array( 'on_focus_load_json' ),
1302 'event_args' => array( 'json_var' => 'currencies' ),
1303 ),
1304 'schema_review_item_product_offer_avail' => array(
1305 'input_title' => _x( 'Product Offer Availability', 'option label', 'wpsso' ),
1306 'input_type' => 'select',
1307 'input_class' => 'stock',
1308 'select_options' => $this->p->cf[ 'form' ][ 'item_availability' ],
1309 'select_default' => 'https://schema.org/InStock',
1310 ),
1311 ), $css_class = 'single_line', $css_id = 'schema_review_item_product_offer',
1312 $args[ 'max_multi' ][ 'metadata_offers' ], $show_first = 2 ),
1313 ),
1314 'schema_review_item_product_retailer_part_no' => array(
1315 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'product' ],
1316 'th_class' => 'medium',
1317 'label' => _x( 'Subject Product SKU', 'option label', 'wpsso' ),
1318 'tooltip' => 'meta-schema_review_item_product_retailer_part_no',
1319 'content' => $form->get_input( 'schema_review_item_product_retailer_part_no' ),
1320 ),
1321 'schema_review_item_product_mfr_part_no' => array(
1322 'tr_class' => 'hide_schema_type ' . $item_type_row_class[ 'product' ],
1323 'th_class' => 'medium',
1324 'label' => _x( 'Subject Product MPN', 'option label', 'wpsso' ),
1325 'tooltip' => 'meta-schema_review_item_product_mfr_part_no',
1326 'content' => $form->get_input( 'schema_review_item_product_mfr_part_no' ),
1327 ),
1328
1329 /*
1330 * Schema CreativeWork > Review > ClaimReview.
1331 */
1332 'subsection_schema_claim_review' => array(
1333 'tr_class' => $args[ 'tr_class_schema' ][ 'review.claim' ],
1334 'td_class' => 'subsection',
1335 'header' => 'h5',
1336 'label' => _x( 'Claim Review Information', 'metabox title', 'wpsso' )
1337 ),
1338 'schema_review_claim_reviewed' => array(
1339 'tr_class' => $args[ 'tr_class_schema' ][ 'review.claim' ],
1340 'th_class' => 'medium',
1341 'label' => _x( 'Short Summary of Claim', 'option label', 'wpsso' ),
1342 'tooltip' => 'meta-schema_review_claim_reviewed',
1343 'content' => $form->get_input( 'schema_review_claim_reviewed', $css_class = 'wide' ),
1344 ),
1345 'schema_review_claim_first_url' => array(
1346 'tr_class' => $args[ 'tr_class_schema' ][ 'review.claim' ],
1347 'th_class' => 'medium',
1348 'label' => _x( 'First Appearance URL', 'option label', 'wpsso' ),
1349 'tooltip' => 'meta-schema_review_claim_first_url',
1350 'content' => $form->get_input( 'schema_review_claim_first_url', $css_class = 'wide' ),
1351 ),
1352 );
1353
1354 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1355 }
1356
1357 /*
1358 * Schema CreativeWork > Software Application.
1359 */
1360 public function filter_mb_sso_edit_schema_software_app_rows( $table_rows, $form, $head_info, $mod, $args ) {
1361
1362 $form_rows = array(
1363 'subsection_schema_software_app' => array(
1364 'tr_class' => $args[ 'tr_class_schema' ][ 'software.application' ],
1365 'td_class' => 'subsection',
1366 'header' => 'h5',
1367 'label' => _x( 'Software App Information', 'metabox title', 'wpsso' )
1368 ),
1369 'schema_software_app_cat' => array(
1370 'tr_class' => $args[ 'tr_class_schema' ][ 'software.application' ],
1371 'th_class' => 'medium',
1372 'label' => _x( 'Application Category', 'option label', 'wpsso' ),
1373 'tooltip' => 'meta-schema_software_app_cat',
1374 'content' => $form->get_input( 'schema_software_app_cat', $css_class = 'wide' ),
1375 ),
1376 'schema_software_app_os' => array(
1377 'tr_class' => $args[ 'tr_class_schema' ][ 'software.application' ],
1378 'th_class' => 'medium',
1379 'label' => _x( 'Operating System', 'option label', 'wpsso' ),
1380 'tooltip' => 'meta-schema_software_app_os',
1381 'content' => $form->get_input( 'schema_software_app_os', $css_class = 'wide' ),
1382 ),
1383 'schema_software_app_dl_url' => array(
1384 'tr_class' => $args[ 'tr_class_schema' ][ 'software.application' ],
1385 'th_class' => 'medium',
1386 'label' => _x( 'Download URL', 'option label', 'wpsso' ),
1387 'tooltip' => 'meta-schema_software_app_dl_url',
1388 'content' => $form->get_input( 'schema_software_app_dl_url', $css_class = 'wide' ),
1389 ),
1390 );
1391
1392 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1393 }
1394
1395 /*
1396 * Schema CreativeWork > WebPage.
1397 */
1398 public function filter_mb_sso_edit_schema_webpage_rows( $table_rows, $form, $head_info, $mod, $args ) {
1399
1400 $form_rows = array(
1401 'subsection_schema_webpage' => array(
1402 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage' ],
1403 'td_class' => 'subsection',
1404 'header' => 'h5',
1405 'label' => _x( 'WebPage Information', 'metabox title', 'wpsso' )
1406 ),
1407 'schema_webpage_reviewed_by_org_id' => array(
1408 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage' ],
1409 'th_class' => 'medium',
1410 'label' => _x( 'Reviewed By Org.', 'option label', 'wpsso' ),
1411 'tooltip' => 'meta-schema_webpage_reviewed_by_org_id',
1412 'content' => $form->get_select_multi( 'schema_webpage_reviewed_by_org_id', $args[ 'select' ][ 'org' ],
1413 $css_class = 'wide', $css_id = '', $is_assoc = true, $args[ 'max_multi' ][ 'reviewed_by' ], $show_first = 1,
1414 $is_disabled = false, $event_names = array( 'on_focus_load_json' ),
1415 $event_args = array( 'json_var' => 'org_names' ) ),
1416 ),
1417 'schema_webpage_reviewed_by_person_id' => array(
1418 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage' ],
1419 'th_class' => 'medium',
1420 'label' => _x( 'Reviewed By Person', 'option label', 'wpsso' ),
1421 'tooltip' => 'meta-schema_webpage_reviewed_by_person_id',
1422 'content' => $form->get_select_multi( 'schema_webpage_reviewed_by_person_id', $args[ 'select' ][ 'person' ],
1423 $css_class = 'wide', $css_id = '', $is_assoc = true, $args[ 'max_multi' ][ 'reviewed_by' ], $show_first = 1,
1424 $is_disabled = false, $event_names = array( 'on_focus_load_json' ),
1425 $event_args = array( 'json_var' => 'person_names' ) ),
1426 ),
1427 'schema_webpage_reviewed_last' => array(
1428 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage' ],
1429 'th_class' => 'medium',
1430 'label' => _x( 'Reviewed Last', 'option label', 'wpsso' ),
1431 'tooltip' => 'meta-schema_webpage_reviewed_last',
1432 'content' => $form->get_date_time_timezone( 'schema_webpage_reviewed_last' ),
1433 ),
1434 );
1435
1436 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1437 }
1438
1439 /*
1440 * Schema CreativeWork > WebPage > ProfilePage.
1441 */
1442 public function filter_mb_sso_edit_schema_profilepage_rows( $table_rows, $form, $head_info, $mod, $args ) {
1443
1444 $form_rows = array(
1445 'subsection_schema_profilepage' => array(
1446 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.profile' ],
1447 'td_class' => 'subsection',
1448 'header' => 'h5',
1449 'label' => _x( 'QA Page Information', 'metabox title', 'wpsso' )
1450 ),
1451 'schema_profile_person_id' => array(
1452 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.profile' ],
1453 'th_class' => 'medium',
1454 'label' => _x( 'Select a Person', 'option label', 'wpsso' ),
1455 'tooltip' => 'meta-schema_profile_person_id',
1456 'content' => $form->get_select( 'schema_profile_person_id', $args[ 'select' ][ 'person' ],
1457 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1458 $selected = false, $event_names = array( 'on_focus_load_json' ),
1459 $event_args = array( 'json_var' => 'person_names' ) ),
1460 ),
1461 );
1462
1463 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1464 }
1465
1466 /*
1467 * Schema CreativeWork > WebPage > QAPage.
1468 */
1469 public function filter_mb_sso_edit_schema_qa_rows( $table_rows, $form, $head_info, $mod, $args ) {
1470
1471 $form_rows = array(
1472 'subsection_schema_qa' => array(
1473 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.qa' ],
1474 'td_class' => 'subsection',
1475 'header' => 'h5',
1476 'label' => _x( 'QA Page Information', 'metabox title', 'wpsso' )
1477 ),
1478 'schema_qa_desc' => array(
1479 'tr_class' => $args[ 'tr_class_schema' ][ 'webpage.qa' ],
1480 'th_class' => 'medium',
1481 'label' => _x( 'QA Heading', 'option label', 'wpsso' ),
1482 'tooltip' => 'meta-schema_qa_desc',
1483 'content' => $form->get_input( 'schema_qa_desc', $css_class = 'wide' ),
1484 ),
1485 );
1486
1487 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1488 }
1489
1490 /*
1491 * Schema Event.
1492 */
1493 public function filter_mb_sso_edit_schema_event_rows( $table_rows, $form, $head_info, $mod, $args ) {
1494
1495 $currencies = SucomUtil::get_currencies_abbrev();
1496
1497 $form_rows = array(
1498 'subsection_schema_event' => array(
1499 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1500 'td_class' => 'subsection',
1501 'header' => 'h5',
1502 'label' => _x( 'Event Information', 'metabox title', 'wpsso' )
1503 ),
1504 'schema_event_lang' => array(
1505 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1506 'th_class' => 'medium',
1507 'label' => _x( 'Event Language', 'option label', 'wpsso' ),
1508 'tooltip' => 'meta-schema_event_lang',
1509 'content' => $form->get_select( 'schema_event_lang', SucomUtilWP::get_available_locales(), $css_class = 'locale' ),
1510 ),
1511 'schema_event_attendance' => array(
1512 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1513 'th_class' => 'medium',
1514 'label' => _x( 'Event Attendance', 'option label', 'wpsso' ),
1515 'tooltip' => 'meta-schema_event_attendance',
1516 'content' => $form->get_select( 'schema_event_attendance', $this->p->cf[ 'form' ][ 'event_attendance' ],
1517 $css_class = '', $css_id = '', $is_assoc = true ),
1518 ),
1519 'schema_event_online_url' => array(
1520 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1521 'th_class' => 'medium',
1522 'label' => _x( 'Event Online URL', 'option label', 'wpsso' ),
1523 'tooltip' => 'meta-schema_event_online_url',
1524 'content' => $form->get_input( 'schema_event_online_url', $css_class = 'wide' ),
1525 ),
1526 'schema_event_location_id' => array(
1527 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1528 'th_class' => 'medium',
1529 'label' => _x( 'Event Venue', 'option label', 'wpsso' ),
1530 'tooltip' => 'meta-schema_event_location_id',
1531 'content' => $form->get_select( 'schema_event_location_id', $args[ 'select' ][ 'place' ],
1532 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1533 $selected = false, $event_names = array( 'on_focus_load_json' ),
1534 $event_args = array( 'json_var' => 'place_names' ) ),
1535 ),
1536 'schema_event_performer_org_id' => array(
1537 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1538 'th_class' => 'medium',
1539 'label' => _x( 'Performer Organization', 'option label', 'wpsso' ),
1540 'tooltip' => 'meta-schema_event_performer_org_id',
1541 'content' => $form->get_select( 'schema_event_performer_org_id', $args[ 'select' ][ 'org' ],
1542 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1543 $selected = false, $event_names = array( 'on_focus_load_json' ),
1544 $event_args = array( 'json_var' => 'org_names' ) ),
1545 ),
1546 'schema_event_performer_person_id' => array(
1547 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1548 'th_class' => 'medium',
1549 'label' => _x( 'Performer Person', 'option label', 'wpsso' ),
1550 'tooltip' => 'meta-schema_event_performer_person_id',
1551 'content' => $form->get_select( 'schema_event_performer_person_id', $args[ 'select' ][ 'person' ],
1552 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1553 $selected = false, $event_names = array( 'on_focus_load_json' ),
1554 $event_args = array( 'json_var' => 'person_names' ) ),
1555 ),
1556 'schema_event_organizer_org_id' => array(
1557 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1558 'th_class' => 'medium',
1559 'label' => _x( 'Organizer Organization', 'option label', 'wpsso' ),
1560 'tooltip' => 'meta-schema_event_organizer_org_id',
1561 'content' => $form->get_select( 'schema_event_organizer_org_id', $args[ 'select' ][ 'org' ],
1562 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1563 $selected = false, $event_names = array( 'on_focus_load_json' ),
1564 $event_args = array( 'json_var' => 'org_names' ) ),
1565 ),
1566 'schema_event_organizer_person_id' => array(
1567 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1568 'th_class' => 'medium',
1569 'label' => _x( 'Organizer Person', 'option label', 'wpsso' ),
1570 'tooltip' => 'meta-schema_event_organizer_person_id',
1571 'content' => $form->get_select( 'schema_event_organizer_person_id', $args[ 'select' ][ 'person' ],
1572 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1573 $selected = false, $event_names = array( 'on_focus_load_json' ),
1574 $event_args = array( 'json_var' => 'person_names' ) ),
1575 ),
1576 'schema_event_fund_org_id' => array(
1577 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1578 'th_class' => 'medium',
1579 'label' => _x( 'Funder Organization', 'option label', 'wpsso' ),
1580 'tooltip' => 'meta-schema_event_fund_org_id',
1581 'content' => $form->get_select( 'schema_event_fund_org_id', $args[ 'select' ][ 'org' ],
1582 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1583 $selected = false, $event_names = array( 'on_focus_load_json' ),
1584 $event_args = array( 'json_var' => 'org_names' ) ),
1585 ),
1586 'schema_event_fund_person_id' => array(
1587 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1588 'th_class' => 'medium',
1589 'label' => _x( 'Funder Person', 'option label', 'wpsso' ),
1590 'tooltip' => 'meta-schema_event_fund_person_id',
1591 'content' => $form->get_select( 'schema_event_fund_person_id', $args[ 'select' ][ 'person' ],
1592 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1593 $selected = false, $event_names = array( 'on_focus_load_json' ),
1594 $event_args = array( 'json_var' => 'person_names' ) ),
1595 ),
1596 'schema_event_status' => array(
1597 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1598 'th_class' => 'medium',
1599 'label' => _x( 'Event Status', 'option label', 'wpsso' ),
1600 'tooltip' => 'meta-schema_event_status',
1601 'content' => $form->get_select( 'schema_event_status', $this->p->cf[ 'form' ][ 'event_status' ],
1602 $css_class = '', $css_id = '', $is_assoc = true ),
1603 ),
1604 'schema_event_start' => array(
1605 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1606 'th_class' => 'medium',
1607 'label' => _x( 'Event Start', 'option label', 'wpsso' ),
1608 'tooltip' => 'meta-schema_event_start',
1609 'content' => $form->get_date_time_timezone( 'schema_event_start' ),
1610 ),
1611 'schema_event_end' => array(
1612 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1613 'th_class' => 'medium',
1614 'label' => _x( 'Event End', 'option label', 'wpsso' ),
1615 'tooltip' => 'meta-schema_event_end',
1616 'content' => $form->get_date_time_timezone( 'schema_event_end' ),
1617 ),
1618 'schema_event_previous' => array(
1619 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1620 'th_class' => 'medium',
1621 'label' => _x( 'Event Previous Start', 'option label', 'wpsso' ),
1622 'tooltip' => 'meta-schema_event_previous',
1623 'content' => $form->get_date_time_timezone( 'schema_event_previous' ),
1624 ),
1625 'schema_event_offers' => array(
1626 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1627 'th_class' => 'medium',
1628 'label' => _x( 'Event Offers', 'option label', 'wpsso' ),
1629 'tooltip' => 'meta-schema_event_offers',
1630 'content' => $form->get_mixed_multi( array(
1631 'schema_event_offer_name' => array(
1632 'input_title' => _x( 'Event Offer Name', 'option label', 'wpsso' ),
1633 'input_type' => 'text',
1634 'input_class' => 'offer_name',
1635 ),
1636 'schema_event_offer_price' => array(
1637 'input_title' => _x( 'Event Offer Price', 'option label', 'wpsso' ),
1638 'input_type' => 'text',
1639 'input_class' => 'price',
1640 ),
1641 'schema_event_offer_currency' => array(
1642 'input_title' => _x( 'Event Offer Currency', 'option label', 'wpsso' ),
1643 'input_type' => 'select',
1644 'input_class' => 'currency',
1645 'select_options' => $currencies,
1646 'select_default' => $this->p->options[ 'og_def_currency' ],
1647 'event_names' => array( 'on_focus_load_json' ),
1648 'event_args' => array( 'json_var' => 'currencies' ),
1649 ),
1650 'schema_event_offer_avail' => array(
1651 'input_title' => _x( 'Event Offer Availability', 'option label', 'wpsso' ),
1652 'input_type' => 'select',
1653 'input_class' => 'stock',
1654 'select_options' => $this->p->cf[ 'form' ][ 'item_availability' ],
1655 'select_default' => 'https://schema.org/InStock',
1656 ),
1657 ), $css_class = 'single_line', $css_id = 'schema_event_offer',
1658 $args[ 'max_multi' ][ 'metadata_offers' ], $show_first = 2 ),
1659 ),
1660 'schema_event_offers_start' => array(
1661 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1662 'th_class' => 'medium',
1663 'label' => _x( 'Event Offers Start', 'option label', 'wpsso' ),
1664 'tooltip' => 'meta-schema_event_offers_start',
1665 'content' => $form->get_date_time_timezone( 'schema_event_offers_start' ),
1666 ),
1667 'schema_event_offers_end' => array(
1668 'tr_class' => $args[ 'tr_class_schema' ][ 'event' ],
1669 'th_class' => 'medium',
1670 'label' => _x( 'Event Offers End', 'option label', 'wpsso' ),
1671 'tooltip' => 'meta-schema_event_offers_end',
1672 'content' => $form->get_date_time_timezone( 'schema_event_offers_end' ),
1673 ),
1674 );
1675
1676 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1677 }
1678
1679 /*
1680 * Schema Intangible > JobPosting.
1681 */
1682 public function filter_mb_sso_edit_schema_job_posting_rows( $table_rows, $form, $head_info, $mod, $args ) {
1683
1684 $currencies = SucomUtil::get_currencies_abbrev();
1685 $def_schema_title = $this->p->page->get_title( $mod, $md_key = 'seo_title', $max_len = 'schema_title' );
1686
1687 $form_rows = array(
1688 'subsection_schema_job_posting' => array(
1689 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1690 'td_class' => 'subsection',
1691 'header' => 'h5',
1692 'label' => _x( 'Job Posting Information', 'metabox title', 'wpsso' )
1693 ),
1694 'schema_job_title' => array(
1695 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1696 'th_class' => 'medium',
1697 'label' => _x( 'Job Title', 'option label', 'wpsso' ),
1698 'tooltip' => 'meta-schema_job_title',
1699 'content' => $form->get_input_dep( 'schema_job_title', $css_class = 'wide', $css_id = '',
1700 $max_len = 0, $def_schema_title, $is_disabled = false, $dep_id = 'schema_title' ),
1701 ),
1702 'schema_job_hiring_org_id' => array(
1703 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1704 'th_class' => 'medium',
1705 'label' => _x( 'Hiring Organization', 'option label', 'wpsso' ),
1706 'tooltip' => 'meta-schema_job_hiring_org_id',
1707 'content' => $form->get_select( 'schema_job_hiring_org_id', $args[ 'select' ][ 'org' ],
1708 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1709 $selected = false, $event_names = array( 'on_focus_load_json' ),
1710 $event_args = array( 'json_var' => 'org_names' ) ),
1711 ),
1712 'schema_job_location_id' => array(
1713 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1714 'th_class' => 'medium',
1715 'label' => _x( 'Job Location', 'option label', 'wpsso' ),
1716 'tooltip' => 'meta-schema_job_location_id',
1717 'content' => $form->get_select( 'schema_job_location_id', $args[ 'select' ][ 'place' ],
1718 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1719 $selected = false, $event_names = array( 'on_focus_load_json' ),
1720 $event_args = array( 'json_var' => 'places_names' ) ),
1721 ),
1722 'schema_job_location_type' => array(
1723 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1724 'th_class' => 'medium',
1725 'label' => _x( 'Job Location Type', 'option label', 'wpsso' ),
1726 'tooltip' => 'meta-schema_job_location_type',
1727 'content' => $form->get_select( 'schema_job_location_type', $this->p->cf[ 'form' ][ 'job_location_type' ],
1728 $css_class = 'long_name', $css_id = '', $is_assoc = true ),
1729 ),
1730 'schema_job_salary' => array(
1731 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1732 'th_class' => 'medium',
1733 'label' => _x( 'Base Salary', 'option label', 'wpsso' ),
1734 'tooltip' => 'meta-schema_job_salary',
1735 'content' => $form->get_input( 'schema_job_salary', $css_class = 'medium' ) . ' ' .
1736 $form->get_select( 'schema_job_salary_currency', $currencies,
1737 $css_class = 'currency', $css_id = '', $is_assoc = true, $is_disabled = false,
1738 $selected = false, $event_names = array( 'on_focus_load_json' ),
1739 $event_args = array( 'json_var' => 'currencies' ) ) . ' ' .
1740 _x( 'per', 'option comment', 'wpsso' ) . ' ' .
1741 $form->get_select( 'schema_job_salary_period', $this->p->cf[ 'form' ][ 'salary_period' ], 'short' ),
1742 ),
1743 'schema_job_empl_type' => array(
1744 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1745 'th_class' => 'medium',
1746 'label' => _x( 'Employment Type', 'option label', 'wpsso' ),
1747 'tooltip' => 'meta-schema_job_empl_type',
1748 'content' => $form->get_checklist( 'schema_job_empl_type', $this->p->cf[ 'form' ][ 'employment_type' ] ),
1749 ),
1750 'schema_job_expire' => array(
1751 'tr_class' => $args[ 'tr_class_schema' ][ 'job.posting' ],
1752 'th_class' => 'medium',
1753 'label' => _x( 'Job Posting Expires', 'option label', 'wpsso' ),
1754 'tooltip' => 'meta-schema_job_expire',
1755 'content' => $form->get_date_time_timezone( 'schema_job_expire' ),
1756 ),
1757 );
1758
1759 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1760 }
1761
1762 /*
1763 * Schema Organization.
1764 */
1765 public function filter_mb_sso_edit_schema_organization_rows( $table_rows, $form, $head_info, $mod, $args ) {
1766
1767 $form_rows = array(
1768 'subsection_schema_organization' => array(
1769 'tr_class' => $args[ 'tr_class_schema' ][ 'organization' ],
1770 'td_class' => 'subsection',
1771 'header' => 'h5',
1772 'label' => _x( 'Organization Information', 'metabox title', 'wpsso' )
1773 ),
1774 'schema_organization_id' => array(
1775 'tr_class' => $args[ 'tr_class_schema' ][ 'organization' ],
1776 'th_class' => 'medium',
1777 'label' => _x( 'Select an Organization', 'option label', 'wpsso' ),
1778 'tooltip' => 'meta-schema_organization_id',
1779 'content' => $form->get_select( 'schema_organization_id', $args[ 'select' ][ 'org' ],
1780 $css_class = 'wide', $css_id = '', $is_assoc = true ),
1781 ),
1782 );
1783
1784 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1785 }
1786
1787 /*
1788 * Schema Person.
1789 */
1790 public function filter_mb_sso_edit_schema_person_rows( $table_rows, $form, $head_info, $mod, $args ) {
1791
1792 $form_rows = array(
1793 'subsection_schema_person' => array(
1794 'tr_class' => $args[ 'tr_class_schema' ][ 'person' ],
1795 'td_class' => 'subsection',
1796 'header' => 'h5',
1797 'label' => _x( 'Person Information', 'metabox title', 'wpsso' )
1798 ),
1799 'schema_person_id' => array(
1800 'tr_class' => $args[ 'tr_class_schema' ][ 'person' ],
1801 'th_class' => 'medium',
1802 'label' => _x( 'Select a Person', 'option label', 'wpsso' ),
1803 'tooltip' => 'meta-schema_person_id',
1804 'content' => $form->get_select( 'schema_person_id', $args[ 'select' ][ 'person' ],
1805 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
1806 $selected = false, $event_names = array( 'on_focus_load_json' ),
1807 $event_args = array( 'json_var' => 'person_names' ) ),
1808 ),
1809 );
1810
1811 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1812 }
1813
1814 /*
1815 * Schema Place.
1816 */
1817 public function filter_mb_sso_edit_schema_place_rows( $table_rows, $form, $head_info, $mod, $args ) {
1818
1819 $form_rows = array(
1820 'subsection_schema_place' => array(
1821 'tr_class' => $args[ 'tr_class_schema' ][ 'place' ],
1822 'td_class' => 'subsection',
1823 'header' => 'h5',
1824 'label' => _x( 'Place Information', 'metabox title', 'wpsso' )
1825 ),
1826 'schema_place_id' => array(
1827 'tr_class' => $args[ 'tr_class_schema' ][ 'place' ],
1828 'th_class' => 'medium',
1829 'label' => _x( 'Select a Place', 'option label', 'wpsso' ),
1830 'tooltip' => 'meta-schema_place_id',
1831 'content' => $form->get_select( 'schema_place_id', $args[ 'select' ][ 'place_custom' ], $css_class = 'wide', $css_id = '',
1832 $is_assoc = true, $is_disabled = false, $selected = false,
1833 $event_names = array( 'on_change_unhide_rows' ) ),
1834 ),
1835 );
1836
1837 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
1838 }
1839
1840 /*
1841 * Schema Product.
1842 */
1843 public function filter_mb_sso_edit_schema_product_rows( $table_rows, $form, $head_info, $mod, $args ) {
1844
1845 $currencies = SucomUtil::get_currencies_abbrev();
1846 $dimension_units = WpssoUtilUnits::get_dimension_units();
1847 $fl_volume_units = WpssoUtilUnits::get_fluid_volume_units();
1848 $weight_units = WpssoUtilUnits::get_weight_units();
1849
1850 /*
1851 * Note that unlike most schema option names, product options start with 'product_' and not 'schema_'.
1852 */
1853 $form_rows = array(
1854 'subsection_schema_product' => array(
1855 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1856 'td_class' => 'subsection',
1857 'header' => 'h5',
1858 'label' => _x( 'Product Information (Main Product)', 'metabox title', 'wpsso' )
1859 ),
1860 'schema_product_ecom_msg' => array(
1861 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1862 'table_row' => empty( $this->p->avail[ 'ecom' ][ 'any' ] ) ? '' :
1863 '<td colspan="2">' . $this->p->msgs->get( 'pro-ecom-product-msg', array( 'mod' => $mod ) ) . '</td>',
1864 ),
1865
1866 /*
1867 * See https://developers.google.com/search/docs/appearance/structured-data/product#json-ld_5.
1868 */
1869 'schema_product_mrp' => array(
1870 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1871 'th_class' => 'medium',
1872 'label' => _x( 'Product Return Policy', 'option label', 'wpsso' ),
1873 'tooltip' => 'meta-product_mrp',
1874 'content' => $form->get_select( 'product_mrp', $args[ 'select' ][ 'mrp' ],
1875 $css_class = 'wide', $css_id = '', $is_assoc = true ),
1876 ),
1877 'schema_product_category' => array( // Product Google Category ID.
1878 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1879 'th_class' => 'medium',
1880 'label' => _x( 'Product Google Category', 'option label', 'wpsso' ),
1881 'tooltip' => 'meta-product_category',
1882 'content' => $form->get_select( 'product_category', $args[ 'select' ][ 'google_prod_cats' ],
1883 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false, $selected = false,
1884 $event_names = array( 'on_focus_load_json' ), $event_args = array(
1885 'json_var' => 'product_categories',
1886 'exp_secs' => WPSSO_CACHE_SELECT_JSON_EXP_SECS, // Create and read from a javascript URL.
1887 'is_transl' => true, // No label translation required.
1888 'is_sorted' => true, // No label sorting required.
1889 )
1890 ),
1891 ),
1892 'schema_product_brand' => array(
1893 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1894 'th_class' => 'medium',
1895 'label' => _x( 'Product Brand', 'option label', 'wpsso' ),
1896 'tooltip' => 'meta-product_brand',
1897 'content' => $form->get_input( 'product_brand', $css_class = 'wide', $css_id = '', $max_len = 0, $holder = true ),
1898 ),
1899 'schema_product_price' => array(
1900 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1901 'th_class' => 'medium',
1902 'label' => _x( 'Product Price', 'option label', 'wpsso' ),
1903 'tooltip' => 'meta-product_price',
1904 'content' => $form->get_input( 'product_price', $css_class = 'price', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
1905 $form->get_select( 'product_currency', $currencies, $css_class = 'currency', $css_id = '',
1906 $is_assoc = true, $is_disabled = false, $selected = false, $event_names = array( 'on_focus_load_json' ),
1907 $event_args = array( 'json_var' => 'currencies' ) ),
1908 ),
1909 'schema_product_price_type' => array(
1910 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1911 'th_class' => 'medium',
1912 'label' => _x( 'Product Price Type', 'option label', 'wpsso' ),
1913 'tooltip' => 'meta-product_price_type',
1914 'content' => $form->get_select( 'product_price_type', $this->p->cf[ 'form' ][ 'price_type' ],
1915 $css_class = '', $css_id = '', $is_assoc = true ),
1916 ),
1917 'schema_product_min_advert_price' => array(
1918 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1919 'th_class' => 'medium',
1920 'label' => _x( 'Product Min Advert Price', 'option label', 'wpsso' ),
1921 'tooltip' => 'meta-product_min_advert_price',
1922 'content' => $form->get_input( 'product_min_advert_price',
1923 $css_class = 'price', $css_id = '', $max_len = 0, $holder = true ),
1924 ),
1925 'schema_product_avail' => array(
1926 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1927 'th_class' => 'medium',
1928 'label' => _x( 'Product Availability', 'option label', 'wpsso' ),
1929 'tooltip' => 'meta-product_avail',
1930 'content' => $form->get_select( 'product_avail', $this->p->cf[ 'form' ][ 'item_availability' ],
1931 $css_class = '', $css_id = '', $is_assoc = true ),
1932 ),
1933 'schema_product_condition' => array(
1934 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1935 'th_class' => 'medium',
1936 'label' => _x( 'Product Condition', 'option label', 'wpsso' ),
1937 'tooltip' => 'meta-product_condition',
1938 'content' => $form->get_select( 'product_condition', $this->p->cf[ 'form' ][ 'item_condition' ],
1939 $css_class = '', $css_id = '', $is_assoc = true ),
1940 ),
1941 'schema_product_energy_efficiency' => array(
1942 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1943 'th_class' => 'medium',
1944 'label' => _x( 'Product Energy Rating', 'option label', 'wpsso' ),
1945 'tooltip' => 'meta-product_energy_efficiency',
1946 'content' => '' .
1947 $form->get_select( 'product_energy_efficiency', $this->p->cf[ 'form' ][ 'energy_efficiency' ],
1948 $css_class = 'energy_efficiency', $css_id = '', $is_assoc = 'sorted' ) . ' ' .
1949 _x( 'from', 'option comment', 'wpsso' ) . ' ' .
1950 $form->get_select( 'product_energy_efficiency_min', $this->p->cf[ 'form' ][ 'energy_efficiency' ],
1951 $css_class = 'energy_efficiency', $css_id = '', $is_assoc = 'sorted' ) . ' ' .
1952 _x( 'to', 'option comment', 'wpsso' ) . ' ' .
1953 $form->get_select( 'product_energy_efficiency_max', $this->p->cf[ 'form' ][ 'energy_efficiency' ],
1954 $css_class = 'energy_efficiency', $css_id = '', $is_assoc = 'sorted' ),
1955 ),
1956 'schema_product_material' => array(
1957 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1958 'th_class' => 'medium',
1959 'label' => _x( 'Product Material', 'option label', 'wpsso' ),
1960 'tooltip' => 'meta-product_material',
1961 'content' => $form->get_input( 'product_material', $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
1962 ),
1963 'schema_product_pattern' => array(
1964 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1965 'th_class' => 'medium',
1966 'label' => _x( 'Product Pattern', 'option label', 'wpsso' ),
1967 'tooltip' => 'meta-product_pattern',
1968 'content' => $form->get_input( 'product_pattern', $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
1969 ),
1970 'schema_product_color' => array(
1971 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1972 'th_class' => 'medium',
1973 'label' => _x( 'Product Color', 'option label', 'wpsso' ),
1974 'tooltip' => 'meta-product_color',
1975 'content' => $form->get_input( 'product_color', $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
1976 ),
1977 'schema_product_target_gender' => array(
1978 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1979 'th_class' => 'medium',
1980 'label' => _x( 'Product Target Gender', 'option label', 'wpsso' ),
1981 'tooltip' => 'meta-product_target_gender',
1982 'content' => $form->get_select( 'product_target_gender', $this->p->cf[ 'form' ][ 'target_gender' ],
1983 $css_class = 'gender', $css_id = '', $is_assoc = true ),
1984 ),
1985 'schema_product_size' => array(
1986 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1987 'th_class' => 'medium',
1988 'label' => _x( 'Product Size', 'option label', 'wpsso' ),
1989 'tooltip' => 'meta-product_size',
1990 'content' => $form->get_input( 'product_size', $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
1991 ),
1992 'schema_product_size_group' => array(
1993 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
1994 'th_class' => 'medium',
1995 'label' => _x( 'Product Size Group', 'option label', 'wpsso' ),
1996 'tooltip' => 'meta-product_size_group',
1997 'content' => '' .
1998 $form->get_select( 'product_size_group_0', $this->p->cf[ 'form' ][ 'size_group' ],
1999 $css_class = 'size_group', $css_id = '', $is_assoc = true ) . ' ' .
2000 $form->get_select( 'product_size_group_1', $this->p->cf[ 'form' ][ 'size_group' ],
2001 $css_class = 'size_group', $css_id = '', $is_assoc = true ),
2002 ),
2003 'schema_product_size_system' => array(
2004 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2005 'th_class' => 'medium',
2006 'label' => _x( 'Product Size System', 'option label', 'wpsso' ),
2007 'tooltip' => 'meta-product_size_system',
2008 'content' => $form->get_select( 'product_size_system', $this->p->cf[ 'form' ][ 'size_system' ] ),
2009 ),
2010 'schema_product_age_group' => $mod[ 'is_public' ] ? array(
2011 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2012 'th_class' => 'medium',
2013 'label' => _x( 'Product Age Group', 'option label', 'wpsso' ),
2014 'tooltip' => 'meta-product_age_group',
2015 'content' => $form->get_select( 'product_age_group', $this->p->cf[ 'form' ][ 'age_group' ] ),
2016 ) : '',
2017 'schema_product_adult_type' => array(
2018 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2019 'th_class' => 'medium',
2020 'label' => _x( 'Product Adult Type', 'option label', 'wpsso' ),
2021 'tooltip' => 'meta-product_adult_type',
2022 'content' => $form->get_select( 'product_adult_type', $this->p->cf[ 'form' ][ 'adult_type' ] ),
2023 ),
2024 'schema_product_length_value' => array(
2025 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2026 'th_class' => 'medium',
2027 'label' => _x( 'Product Net Len. / Depth', 'option label', 'wpsso' ),
2028 'tooltip' => 'meta-product_length_value',
2029 'content' => $form->get_input( 'product_length_value',
2030 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2031 $form->get_select( 'product_length_units', $dimension_units,
2032 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2033 ),
2034 'schema_product_width_value' => array(
2035 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2036 'th_class' => 'medium',
2037 'label' => _x( 'Product Net Width', 'option label', 'wpsso' ),
2038 'tooltip' => 'meta-product_width_value',
2039 'content' => $form->get_input( 'product_width_value',
2040 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2041 $form->get_select( 'product_width_units', $dimension_units,
2042 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2043 ),
2044 'schema_product_height_value' => array(
2045 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2046 'th_class' => 'medium',
2047 'label' => _x( 'Product Net Height', 'option label', 'wpsso' ),
2048 'tooltip' => 'meta-product_height_value',
2049 'content' => $form->get_input( 'product_height_value',
2050 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2051 $form->get_select( 'product_height_units', $dimension_units,
2052 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2053 ),
2054 'schema_product_weight_value' => array(
2055 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2056 'th_class' => 'medium',
2057 'label' => _x( 'Product Net Weight', 'option label', 'wpsso' ),
2058 'tooltip' => 'meta-product_weight_value',
2059 'content' => $form->get_input( 'product_weight_value',
2060 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2061 $form->get_select( 'product_weight_units', $weight_units,
2062 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2063 ),
2064 'schema_product_fluid_volume_value' => array(
2065 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2066 'th_class' => 'medium',
2067 'label' => _x( 'Product Fluid Volume', 'option label', 'wpsso' ),
2068 'tooltip' => 'meta-product_fluid_volume_value',
2069 'content' => $form->get_input( 'product_fluid_volume_value',
2070 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2071 $form->get_select( 'product_fluid_volume_units', $fl_volume_units,
2072 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2073 ),
2074 'schema_product_shipping_length_value' => array(
2075 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2076 'th_class' => 'medium',
2077 'label' => _x( 'Product Shipping Length', 'option label', 'wpsso' ),
2078 'tooltip' => 'meta-product_shipping_length_value',
2079 'content' => $form->get_input( 'product_shipping_length_value',
2080 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2081 $form->get_select( 'product_shipping_length_units', $dimension_units,
2082 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2083 ),
2084 'schema_product_shipping_width_value' => array(
2085 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2086 'th_class' => 'medium',
2087 'label' => _x( 'Product Shipping Width', 'option label', 'wpsso' ),
2088 'tooltip' => 'meta-product_shipping_width_value',
2089 'content' => $form->get_input( 'product_shipping_width_value',
2090 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2091 $form->get_select( 'product_shipping_width_units', $dimension_units,
2092 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2093 ),
2094 'schema_product_shipping_height_value' => array(
2095 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2096 'th_class' => 'medium',
2097 'label' => _x( 'Product Shipping Height', 'option label', 'wpsso' ),
2098 'tooltip' => 'meta-product_shipping_height_value',
2099 'content' => $form->get_input( 'product_shipping_height_value',
2100 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2101 $form->get_select( 'product_shipping_height_units', $dimension_units,
2102 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2103 ),
2104 'schema_product_shipping_weight_value' => array(
2105 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2106 'th_class' => 'medium',
2107 'label' => _x( 'Product Shipping Weight', 'option label', 'wpsso' ),
2108 'tooltip' => 'meta-product_shipping_weight_value',
2109 'content' => $form->get_input( 'product_shipping_weight_value',
2110 $css_class = 'unit_value', $css_id = '', $max_len = 0, $holder = true ) . ' ' .
2111 $form->get_select( 'product_shipping_weight_units', $weight_units,
2112 $css_class = 'unit_text', $css_id = '', $is_assoc = 'sorted' ),
2113 ),
2114 'schema_product_retailer_part_no' => array(
2115 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2116 'th_class' => 'medium',
2117 'label' => _x( 'Product SKU', 'option label', 'wpsso' ),
2118 'tooltip' => 'meta-product_retailer_part_no',
2119 'content' => $form->get_input( 'product_retailer_part_no',
2120 $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
2121 ),
2122 'schema_product_mfr_part_no' => array(
2123 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2124 'th_class' => 'medium',
2125 'label' => _x( 'Product MPN', 'option label', 'wpsso' ),
2126 'tooltip' => 'meta-product_mfr_part_no',
2127 'content' => $form->get_input( 'product_mfr_part_no',
2128 $css_class = '', $css_id = '', $max_len = 0, $holder = true ),
2129 ),
2130 'schema_product_gtin14' => array(
2131 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2132 'th_class' => 'medium',
2133 'label' => _x( 'Product GTIN-14', 'option label', 'wpsso' ),
2134 'tooltip' => 'meta-product_gtin14',
2135 'content' => $form->get_input( 'product_gtin14',
2136 $css_class = '', $css_id = '', array( 'min' => 14, 'max' => 14 ), $holder = true ),
2137 ),
2138 'schema_product_gtin13' => array(
2139 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2140 'th_class' => 'medium',
2141 'label' => _x( 'Product GTIN-13 (EAN)', 'option label', 'wpsso' ), // aka Product EAN.
2142 'tooltip' => 'meta-product_gtin13',
2143 'content' => $form->get_input( 'product_gtin13',
2144 $css_class = '', $css_id = '', array( 'min' => 13, 'max' => 13 ), $holder = true ),
2145 ),
2146 'schema_product_gtin12' => array(
2147 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2148 'th_class' => 'medium',
2149 'label' => _x( 'Product GTIN-12 (UPC)', 'option label', 'wpsso' ), // aka Product UPC.
2150 'tooltip' => 'meta-product_gtin12',
2151 'content' => $form->get_input( 'product_gtin12',
2152 $css_class = '', $css_id = '', array( 'min' => 12, 'max' => 12 ), $holder = true ),
2153 ),
2154 'schema_product_gtin8' => array(
2155 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2156 'th_class' => 'medium',
2157 'label' => _x( 'Product GTIN-8', 'option label', 'wpsso' ),
2158 'tooltip' => 'meta-product_gtin8',
2159 'content' => $form->get_input( 'product_gtin8',
2160 $css_class = '', $css_id = '', array( 'min' => 8, 'max' => 8 ), $holder = true ),
2161 ),
2162 'schema_product_gtin' => array(
2163 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2164 'th_class' => 'medium',
2165 'label' => _x( 'Product GTIN', 'option label', 'wpsso' ),
2166 'tooltip' => 'meta-product_gtin',
2167 'content' => $form->get_input( 'product_gtin',
2168 $css_class = '', $css_id = '', array( 'min' => 8, 'max' => 14 ), $holder = true ),
2169 ),
2170 'schema_product_isbn' => array(
2171 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2172 'th_class' => 'medium',
2173 'label' => _x( 'Product ISBN', 'option label', 'wpsso' ),
2174 'tooltip' => 'meta-product_isbn',
2175 'content' => $form->get_input( 'product_isbn',
2176 $css_class = '', $css_id = '', array( 'min' => 10, 'max' => 13 ), $holder = true ),
2177 ),
2178 'schema_product_award' => array(
2179 'tr_class' => $args[ 'tr_class_schema' ][ 'product' ],
2180 'th_class' => 'medium',
2181 'label' => _x( 'Product Awards', 'option label', 'wpsso' ),
2182 'tooltip' => 'meta-product_award',
2183 'content' => $form->get_input_multi( 'product_award', $css_class = 'wide', $css_id = '',
2184 $args[ 'max_multi' ][ 'awards' ], $show_first = 1 ),
2185 ),
2186
2187 );
2188
2189 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
2190 }
2191
2192 /*
2193 * Schema Service.
2194 */
2195 public function filter_mb_sso_edit_schema_service_rows( $table_rows, $form, $head_info, $mod, $args ) {
2196
2197 $currencies = SucomUtil::get_currencies_abbrev();
2198
2199 $form_rows = array(
2200 'schema_service_prov_org_id' => array(
2201 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2202 'th_class' => 'medium',
2203 'label' => _x( 'Provider Organization', 'option label', 'wpsso' ),
2204 'tooltip' => 'meta-schema_service_prov_org_id',
2205 'content' => $form->get_select( 'schema_service_prov_org_id', $args[ 'select' ][ 'org' ],
2206 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
2207 $selected = false, $event_names = array( 'on_focus_load_json' ),
2208 $event_args = array( 'json_var' => 'org_names' ) ),
2209 ),
2210 'schema_service_prov_person_id' => array(
2211 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2212 'th_class' => 'medium',
2213 'label' => _x( 'Provider Person', 'option label', 'wpsso' ),
2214 'tooltip' => 'meta-schema_service_prov_person_id',
2215 'content' => $form->get_select( 'schema_service_prov_person_id', $args[ 'select' ][ 'person' ],
2216 $css_class = 'wide', $css_id = '', $is_assoc = true, $is_disabled = false,
2217 $selected = false, $event_names = array( 'on_focus_load_json' ),
2218 $event_args = array( 'json_var' => 'person_names' ) ),
2219 ),
2220 'schema_service_award' => array(
2221 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2222 'th_class' => 'medium',
2223 'label' => _x( 'Service Awards', 'option label', 'wpsso' ),
2224 'tooltip' => 'meta-schema_service_award',
2225 'content' => $form->get_input_multi( 'schema_service_award', $css_class = 'wide', $css_id = '',
2226 $args[ 'max_multi' ][ 'awards' ], $show_first = 1),
2227 ),
2228 'subsection_schema_service_offers' => array(
2229 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2230 'td_class' => 'subsection',
2231 'header' => 'h5',
2232 'label' => _x( 'Service Offers Information', 'metabox title', 'wpsso' )
2233 ),
2234 'schema_service_offers' => array(
2235 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2236 'th_class' => 'medium',
2237 'label' => _x( 'Service Offers', 'option label', 'wpsso' ),
2238 'tooltip' => 'meta-schema_service_offers',
2239 'content' => $form->get_mixed_multi( array(
2240 'schema_service_offer_name' => array(
2241 'input_title' => _x( 'Service Offer Name', 'option label', 'wpsso' ),
2242 'input_type' => 'text',
2243 'input_class' => 'offer_name',
2244 ),
2245 'schema_service_offer_price' => array(
2246 'input_title' => _x( 'Service Offer Price', 'option label', 'wpsso' ),
2247 'input_type' => 'text',
2248 'input_class' => 'price',
2249 ),
2250 'schema_service_offer_currency' => array(
2251 'input_title' => _x( 'Service Offer Currency', 'option label', 'wpsso' ),
2252 'input_type' => 'select',
2253 'input_class' => 'currency',
2254 'select_options' => $currencies,
2255 'select_default' => $this->p->options[ 'og_def_currency' ],
2256 'event_names' => array( 'on_focus_load_json' ),
2257 'event_args' => array( 'json_var' => 'currencies' ),
2258 ),
2259 'schema_service_offer_avail' => array(
2260 'input_title' => _x( 'Service Offer Availability', 'option label', 'wpsso' ),
2261 'input_type' => 'select',
2262 'input_class' => 'stock',
2263 'select_options' => $this->p->cf[ 'form' ][ 'item_availability' ],
2264 'select_default' => 'https://schema.org/InStock',
2265 ),
2266 ), $css_class = 'single_line', $css_id = 'schema_service_offer',
2267 $args[ 'max_multi' ][ 'metadata_offers' ], $show_first = 2 ),
2268 ),
2269 'schema_service_offers_start' => array(
2270 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2271 'th_class' => 'medium',
2272 'label' => _x( 'Service Offers Start', 'option label', 'wpsso' ),
2273 'tooltip' => 'meta-schema_service_offers_start',
2274 'content' => $form->get_date_time_timezone( 'schema_service_offers_start' ),
2275 ),
2276 'schema_service_offers_end' => array(
2277 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2278 'th_class' => 'medium',
2279 'label' => _x( 'Service Offers End', 'option label', 'wpsso' ),
2280 'tooltip' => 'meta-schema_service_offers_end',
2281 'content' => $form->get_date_time_timezone( 'schema_service_offers_end' ),
2282 ),
2283 'schema_service_offer_catalogs' => array(
2284 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2285 'th_class' => 'medium',
2286 'label' => _x( 'Offer Catalogs', 'option label', 'wpsso' ),
2287 'tooltip' => 'meta-schema_service_offer_catalogs',
2288 'content' => $form->get_mixed_multi( array(
2289 'schema_service_offer_catalog' => array(
2290 'input_label' => _x( 'Offer Catalog Name', 'option label', 'wpsso' ),
2291 'input_type' => 'text',
2292 'input_class' => 'wide offer_catalog_name',
2293 ),
2294 'schema_service_offer_catalog_text' => array(
2295 'input_label' => _x( 'Offer Catalog Description', 'option label', 'wpsso' ),
2296 'input_type' => 'textarea',
2297 'input_class' => 'wide offer_catalog_text',
2298 ),
2299 'schema_service_offer_catalog_url' => array(
2300 'input_label' => _x( 'Offer Catalog URL', 'option label', 'wpsso' ),
2301 'input_type' => 'text',
2302 'input_class' => 'wide offer_catalog_url',
2303 ),
2304 ), $css_class = '', $css_id = 'schema_service_offer_catalogs',
2305 $args[ 'max_multi' ][ 'offer_catalogs' ], $show_first = 1 ),
2306 ),
2307 'subsection_schema_service_area' => array(
2308 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2309 'td_class' => 'subsection',
2310 'header' => 'h5',
2311 'label' => _x( 'Service Area Information', 'metabox title', 'wpsso' )
2312 ),
2313 'schema_service_latitude' => array(
2314 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2315 'th_class' => 'medium',
2316 'label' => _x( 'Service Latitude', 'option label', 'wpsso' ),
2317 'tooltip' => 'meta-schema_service_latitude',
2318 'content' => $form->get_input( 'schema_service_latitude', $css_class = 'latitude' ) . ' ' .
2319 _x( 'decimal degrees', 'option comment', 'wpsso' ),
2320 ),
2321 'schema_service_longitude' => array(
2322 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2323 'th_class' => 'medium',
2324 'label' => _x( 'Service Longitude', 'option label', 'wpsso' ),
2325 'tooltip' => 'meta-schema_service_longitude',
2326 'content' => $form->get_input( 'schema_service_longitude', $css_class = 'longitude' ) . ' ' .
2327 _x( 'decimal degrees', 'option comment', 'wpsso' ),
2328 ),
2329 'schema_service_radius' => array(
2330 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2331 'th_class' => 'medium',
2332 'label' => _x( 'Service Radius', 'option label', 'wpsso' ),
2333 'tooltip' => 'meta-schema_service_radius',
2334 'content' => $form->get_input( 'schema_service_radius', $css_class = 'short' ) . ' ' .
2335 _x( 'meters from coordinates', 'option comment', 'wpsso' ),
2336 ),
2337 'schema_service_area_id' => array(
2338 'tr_class' => $args[ 'tr_class_schema' ][ 'service' ],
2339 'th_class' => 'medium',
2340 'label' => _x( 'Service Areas', 'option label', 'wpsso' ),
2341 'tooltip' => 'meta-schema_service_area_id',
2342 'content' => $form->get_select_multi( 'schema_service_area_id', $args[ 'select' ][ 'service_areas' ],
2343 $css_class = 'wide', $css_id = '', $is_assoc = true, $args[ 'max_multi' ][ 'service_areas' ], $show_first = 1,
2344 $is_disabled = false, $event_names = array( 'on_focus_load_json' ),
2345 $event_args = array( 'json_var' => 'service_areas_names' ) ),
2346 ),
2347 );
2348
2349 return $form->get_md_form_rows( $table_rows, $form_rows, $head_info, $mod );
2350 }
2351 }
2352 }
2353