Markup (JSON-LD) structured in schema.org - Version 3.1.4

Version Description

(2016-11-25) = * Added : Schema.org type "LocalBusiness" item added. "Image", "priceRange" and "servesCuisine". * Added : Print plugin version in comments.

Download this release

Release Info

Developer miiitaka
Plugin Icon 128x128 Markup (JSON-LD) structured in schema.org
Version 3.1.4
Comparing to
See all releases

Code changes from version 3.1.3 to 3.1.4

includes/wp-structuring-admin-type-article.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type Article
4
  *
5
  * @author Kazuya Takami
6
- * @version 3.0.5
7
  * @since 1.1.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/Article
@@ -29,7 +29,7 @@ class Structuring_Markup_Type_Article {
29
  /**
30
  * Form Layout Render
31
  *
32
- * @version 3.0.5
33
  * @since 1.1.0
34
  * @param array $option
35
  */
@@ -59,6 +59,14 @@ class Structuring_Markup_Type_Article {
59
  $html .= '</table>';
60
  echo $html;
61
 
 
 
 
 
 
 
 
 
62
  $html = '<table class="schema-admin-table">';
63
  $html .= '<caption>publisher</caption>';
64
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
3
  * Schema.org Type Article
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.1.4
7
  * @since 1.1.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/Article
29
  /**
30
  * Form Layout Render
31
  *
32
+ * @version 3.1.4
33
  * @since 1.1.0
34
  * @param array $option
35
  */
59
  $html .= '</table>';
60
  echo $html;
61
 
62
+ $html = '<table class="schema-admin-table">';
63
+ $html .= '<caption>author</caption>';
64
+ $html .= '<tr><th>@type :</th><td><small>"Person"</small></td></tr>';
65
+ $html .= '<tr><th class="require">name :</th><td><small>Default : get_the_author_meta( "display_name", author )</small>';
66
+ $html .= '</td></tr>';
67
+ $html .= '</table>';
68
+ echo $html;
69
+
70
  $html = '<table class="schema-admin-table">';
71
  $html .= '<caption>publisher</caption>';
72
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
includes/wp-structuring-admin-type-blog-posting.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type BlogPosting
4
  *
5
  * @author Kazuya Takami
6
- * @version 3.0.5
7
  * @since 1.2.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/BlogPosting
@@ -29,7 +29,7 @@ class Structuring_Markup_Type_Blog_Posting {
29
  /**
30
  * Form Layout Render
31
  *
32
- * @version 3.0.5
33
  * @since 1.2.0
34
  * @param array $option
35
  */
@@ -59,6 +59,14 @@ class Structuring_Markup_Type_Blog_Posting {
59
  $html .= '</table>';
60
  echo $html;
61
 
 
 
 
 
 
 
 
 
62
  $html = '<table class="schema-admin-table">';
63
  $html .= '<caption>publisher</caption>';
64
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
3
  * Schema.org Type BlogPosting
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.1.4
7
  * @since 1.2.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/BlogPosting
29
  /**
30
  * Form Layout Render
31
  *
32
+ * @version 3.1.4
33
  * @since 1.2.0
34
  * @param array $option
35
  */
59
  $html .= '</table>';
60
  echo $html;
61
 
62
+ $html = '<table class="schema-admin-table">';
63
+ $html .= '<caption>author</caption>';
64
+ $html .= '<tr><th>@type :</th><td><small>"Person"</small></td></tr>';
65
+ $html .= '<tr><th class="require">name :</th><td><small>Default : get_the_author_meta( "display_name", author )</small>';
66
+ $html .= '</td></tr>';
67
+ $html .= '</table>';
68
+ echo $html;
69
+
70
  $html = '<table class="schema-admin-table">';
71
  $html .= '<caption>publisher</caption>';
72
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
includes/wp-structuring-admin-type-local-business.php CHANGED
@@ -191,21 +191,25 @@ class Structuring_Markup_Type_LocalBusiness {
191
  /**
192
  * Constructor Define.
193
  *
194
- * @since 2.3.0
195
- * @param array $option
 
196
  */
197
  public function __construct ( array $option ) {
198
  /** Default Value Set */
199
- if ( empty( $option ) ) {
200
- $option = $this->get_default_options( $option );
 
 
201
  }
202
- $this->page_render( $option );
 
203
  }
204
 
205
  /**
206
  * Form Layout Render
207
  *
208
- * @version 3.0.5
209
  * @since 2.3.3
210
  * @param array $option
211
  */
@@ -214,6 +218,7 @@ class Structuring_Markup_Type_LocalBusiness {
214
  $html = '<table class="schema-admin-table">';
215
  $html .= '<caption>Local Business</caption>';
216
  $html .= $this->set_form_select( 'business_type', 'Local Business Type', $option['business_type'], 'Default : "Local Business"' );
 
217
  $html .= $this->set_form_text( 'name', 'Business Name', $option['name'], true, 'Default : bloginfo("name")' );
218
  $html .= $this->set_form_text( 'url', 'Url', $option['url'], true, 'Default : bloginfo("url")' );
219
  $html .= $this->set_form_text( 'telephone', 'Telephone', $option['telephone'], false, 'e.g. : +1-880-555-1212' );
@@ -223,15 +228,10 @@ class Structuring_Markup_Type_LocalBusiness {
223
  /** For food establishments */
224
  $html = '<table class="schema-admin-table">';
225
  $html .= '<caption>For food establishments</caption>';
226
- if ( !isset( $option['food_active'] ) ) {
227
- $option['food_active'] = "";
228
- }
229
  $html .= $this->set_form_checkbox( 'food_active', 'Setting', $option['food_active'], 'Enabled' );
230
  $html .= $this->set_form_text( 'menu', 'Menu url', $option['menu'], false, 'For food establishments, the fully-qualified URL of the menu.' );
231
- if ( !isset( $option['accepts_reservations'] ) ) {
232
- $option['accepts_reservations'] = "";
233
- }
234
  $html .= $this->set_form_checkbox( 'accepts_reservations', 'Accepts Reservations', $option['accepts_reservations'], 'For food establishments, and whether it is possible to accept a reservation?' );
 
235
  $html .= '</table>';
236
  echo $html;
237
 
@@ -249,12 +249,6 @@ class Structuring_Markup_Type_LocalBusiness {
249
  /** Geo Circle */
250
  $html = '<table class="schema-admin-table">';
251
  $html .= '<caption>Geo Circle</caption>';
252
- if ( !isset( $option['geo_circle_active'] ) ) {
253
- $option['geo_circle_active'] = "";
254
- }
255
- if ( !isset( $option['geo_circle_radius'] ) ) {
256
- $option['geo_circle_radius'] = "";
257
- }
258
  $html .= $this->set_form_checkbox( 'geo_circle_active', 'Setting', $option['geo_circle_active'], 'Enabled' );
259
  $html .= $this->set_form_text( 'geo_circle_radius', 'geoRadius', $option['geo_circle_radius'], false );
260
  $html .= '</table>';
@@ -263,9 +257,6 @@ class Structuring_Markup_Type_LocalBusiness {
263
  /** Geo Coordinates */
264
  $html = '<table class="schema-admin-table">';
265
  $html .= '<caption>Geo Coordinates</caption>';
266
- if ( !isset( $option['geo_active'] ) ) {
267
- $option['geo_active'] = "";
268
- }
269
  $html .= $this->set_form_checkbox( 'geo_active', 'Setting', $option['geo_active'], 'Enabled' );
270
  $html .= $this->set_form_text( 'latitude', 'Latitude', $option['latitude'], false );
271
  $html .= $this->set_form_text( 'longitude', 'Longitude', $option['longitude'], false );
@@ -308,21 +299,6 @@ class Structuring_Markup_Type_LocalBusiness {
308
  /** Holiday Opening Hours */
309
  $html = '<table class="schema-admin-table">';
310
  $html .= '<caption>Holiday Opening Hours</caption>';
311
- if ( !isset( $option['holiday_active'] ) ) {
312
- $option['holiday_active'] = "";
313
- }
314
- if ( !isset( $option['holiday_open'] ) ) {
315
- $option['holiday_open'] = "";
316
- }
317
- if ( !isset( $option['holiday_close'] ) ) {
318
- $option['holiday_close'] = "";
319
- }
320
- if ( !isset( $option['holiday_valid_from'] ) ) {
321
- $option['holiday_valid_from'] = "";
322
- }
323
- if ( !isset( $option['holiday_valid_through'] ) ) {
324
- $option['holiday_valid_through'] = "";
325
- }
326
  $html .= $this->set_form_checkbox( 'holiday_active', 'Setting', $option['holiday_active'], 'Enabled' );
327
  $html .= $this->set_form_time_holiday( $option['holiday_open'], $option['holiday_close'] );
328
  $html .= $this->set_form_date( 'holiday_valid_from', 'validFrom', $option['holiday_valid_from'], false );
@@ -331,6 +307,13 @@ class Structuring_Markup_Type_LocalBusiness {
331
  $html .= '</table>';
332
  echo $html;
333
 
 
 
 
 
 
 
 
334
  echo '<p>Setting Knowledge : <a href="https://developers.google.com/search/docs/data-types/local-businesses" target="_blank">https://developers.google.com/search/docs/data-types/local-businesses</a></p>';
335
  submit_button();
336
  }
@@ -338,24 +321,27 @@ class Structuring_Markup_Type_LocalBusiness {
338
  /**
339
  * Return the default options array
340
  *
341
- * @since 2.3.0
342
  * @version 2.5.0
343
- * @param array $args
344
  * @return array $args
345
  */
346
- private function get_default_options ( array $args ) {
347
  $args['business_type'] = 'local_business';
348
  $args['name'] = get_bloginfo('name');
 
349
  $args['url'] = get_bloginfo('url');
350
  $args['telephone'] = '';
351
  $args['food_active'] = '';
352
  $args['menu'] = '';
353
  $args['accepts_reservations'] = '';
 
354
  $args['street_address'] = '';
355
  $args['address_locality'] = '';
356
  $args['address_region'] = '';
357
  $args['postal_code'] = '';
358
  $args['address_country'] = '';
 
 
359
  $args['geo_active'] = '';
360
  $args['latitude'] = '';
361
  $args['longitude'] = '';
@@ -372,6 +358,7 @@ class Structuring_Markup_Type_LocalBusiness {
372
  $args['holiday_close'] = '';
373
  $args['holiday_valid_from'] = '';
374
  $args['holiday_valid_through'] = '';
 
375
 
376
  return (array) $args;
377
  }
191
  /**
192
  * Constructor Define.
193
  *
194
+ * @version 3.1.4
195
+ * @since 2.3.0
196
+ * @param array $option
197
  */
198
  public function __construct ( array $option ) {
199
  /** Default Value Set */
200
+ $option_array = $this->get_default_options();
201
+
202
+ if ( !empty( $option ) ) {
203
+ $option_array = array_merge( $option_array, $option );
204
  }
205
+
206
+ $this->page_render( $option_array );
207
  }
208
 
209
  /**
210
  * Form Layout Render
211
  *
212
+ * @version 3.1.4
213
  * @since 2.3.3
214
  * @param array $option
215
  */
218
  $html = '<table class="schema-admin-table">';
219
  $html .= '<caption>Local Business</caption>';
220
  $html .= $this->set_form_select( 'business_type', 'Local Business Type', $option['business_type'], 'Default : "Local Business"' );
221
+ $html .= $this->set_form_text( 'image', 'An image of the business', $option['image'], true, 'Default : bloginfo("url")' );
222
  $html .= $this->set_form_text( 'name', 'Business Name', $option['name'], true, 'Default : bloginfo("name")' );
223
  $html .= $this->set_form_text( 'url', 'Url', $option['url'], true, 'Default : bloginfo("url")' );
224
  $html .= $this->set_form_text( 'telephone', 'Telephone', $option['telephone'], false, 'e.g. : +1-880-555-1212' );
228
  /** For food establishments */
229
  $html = '<table class="schema-admin-table">';
230
  $html .= '<caption>For food establishments</caption>';
 
 
 
231
  $html .= $this->set_form_checkbox( 'food_active', 'Setting', $option['food_active'], 'Enabled' );
232
  $html .= $this->set_form_text( 'menu', 'Menu url', $option['menu'], false, 'For food establishments, the fully-qualified URL of the menu.' );
 
 
 
233
  $html .= $this->set_form_checkbox( 'accepts_reservations', 'Accepts Reservations', $option['accepts_reservations'], 'For food establishments, and whether it is possible to accept a reservation?' );
234
+ $html .= $this->set_form_text( 'serves_cuisine', 'Serves Cuisine', $option['serves_cuisine'], false, 'If marking up a restaurant, provide the type of cuisine they serve.' );
235
  $html .= '</table>';
236
  echo $html;
237
 
249
  /** Geo Circle */
250
  $html = '<table class="schema-admin-table">';
251
  $html .= '<caption>Geo Circle</caption>';
 
 
 
 
 
 
252
  $html .= $this->set_form_checkbox( 'geo_circle_active', 'Setting', $option['geo_circle_active'], 'Enabled' );
253
  $html .= $this->set_form_text( 'geo_circle_radius', 'geoRadius', $option['geo_circle_radius'], false );
254
  $html .= '</table>';
257
  /** Geo Coordinates */
258
  $html = '<table class="schema-admin-table">';
259
  $html .= '<caption>Geo Coordinates</caption>';
 
 
 
260
  $html .= $this->set_form_checkbox( 'geo_active', 'Setting', $option['geo_active'], 'Enabled' );
261
  $html .= $this->set_form_text( 'latitude', 'Latitude', $option['latitude'], false );
262
  $html .= $this->set_form_text( 'longitude', 'Longitude', $option['longitude'], false );
299
  /** Holiday Opening Hours */
300
  $html = '<table class="schema-admin-table">';
301
  $html .= '<caption>Holiday Opening Hours</caption>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  $html .= $this->set_form_checkbox( 'holiday_active', 'Setting', $option['holiday_active'], 'Enabled' );
303
  $html .= $this->set_form_time_holiday( $option['holiday_open'], $option['holiday_close'] );
304
  $html .= $this->set_form_date( 'holiday_valid_from', 'validFrom', $option['holiday_valid_from'], false );
307
  $html .= '</table>';
308
  echo $html;
309
 
310
+ /** Price Range */
311
+ $html = '<table class="schema-admin-table">';
312
+ $html .= '<caption>Price Range</caption>';
313
+ $html .= $this->set_form_text( 'price_range', 'Price Range', $option['price_range'], false, 'The price range of the business, for example $$$.' );
314
+ $html .= '</table>';
315
+ echo $html;
316
+
317
  echo '<p>Setting Knowledge : <a href="https://developers.google.com/search/docs/data-types/local-businesses" target="_blank">https://developers.google.com/search/docs/data-types/local-businesses</a></p>';
318
  submit_button();
319
  }
321
  /**
322
  * Return the default options array
323
  *
324
+ * @since 3.1.4
325
  * @version 2.5.0
 
326
  * @return array $args
327
  */
328
+ private function get_default_options () {
329
  $args['business_type'] = 'local_business';
330
  $args['name'] = get_bloginfo('name');
331
+ $args['image'] = get_bloginfo('url');
332
  $args['url'] = get_bloginfo('url');
333
  $args['telephone'] = '';
334
  $args['food_active'] = '';
335
  $args['menu'] = '';
336
  $args['accepts_reservations'] = '';
337
+ $args['serves_cuisine'] = '';
338
  $args['street_address'] = '';
339
  $args['address_locality'] = '';
340
  $args['address_region'] = '';
341
  $args['postal_code'] = '';
342
  $args['address_country'] = '';
343
+ $args['geo_circle_active'] = '';
344
+ $args['geo_circle_radius'] = '';
345
  $args['geo_active'] = '';
346
  $args['latitude'] = '';
347
  $args['longitude'] = '';
358
  $args['holiday_close'] = '';
359
  $args['holiday_valid_from'] = '';
360
  $args['holiday_valid_through'] = '';
361
+ $args['price_range'] = '';
362
 
363
  return (array) $args;
364
  }
includes/wp-structuring-admin-type-news-article.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type News Article
4
  *
5
  * @author Kazuya Takami
6
- * @version 3.0.5
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/NewsArticle
@@ -29,7 +29,7 @@ class Structuring_Markup_Type_NewsArticle {
29
  /**
30
  * Form Layout Render
31
  *
32
- * @version 3.0.5
33
  * @since 1.0.0
34
  * @param array $option
35
  */
@@ -59,6 +59,14 @@ class Structuring_Markup_Type_NewsArticle {
59
  $html .= '</table>';
60
  echo $html;
61
 
 
 
 
 
 
 
 
 
62
  $html = '<table class="schema-admin-table">';
63
  $html .= '<caption>publisher</caption>';
64
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
3
  * Schema.org Type News Article
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.1.4
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link http://schema.org/NewsArticle
29
  /**
30
  * Form Layout Render
31
  *
32
+ * @version 3.1.4
33
  * @since 1.0.0
34
  * @param array $option
35
  */
59
  $html .= '</table>';
60
  echo $html;
61
 
62
+ $html = '<table class="schema-admin-table">';
63
+ $html .= '<caption>author</caption>';
64
+ $html .= '<tr><th>@type :</th><td><small>"Person"</small></td></tr>';
65
+ $html .= '<tr><th class="require">name :</th><td><small>Default : get_the_author_meta( "display_name", author )</small>';
66
+ $html .= '</td></tr>';
67
+ $html .= '</table>';
68
+ echo $html;
69
+
70
  $html = '<table class="schema-admin-table">';
71
  $html .= '<caption>publisher</caption>';
72
  $html .= '<tr><th>@type :</th><td><small>"Organization"</small></td></tr>';
includes/wp-structuring-admin-type-organization.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type Organization
4
  *
5
  * @author Kazuya Takami
6
- * @version 3.0.5
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/Organization
@@ -62,7 +62,7 @@ class Structuring_Markup_Type_Organization {
62
  /**
63
  * Form Layout Render
64
  *
65
- * @version 3.0.5
66
  * @since 1.0.0
67
  * @param array $option
68
  */
@@ -80,7 +80,7 @@ class Structuring_Markup_Type_Organization {
80
  $html .= '</td></tr>';
81
  $html .= '<tr><th class="require"><label for="logo">logo :</label></th><td>';
82
  $html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
83
- $html .= '<small>Default : bloginfo("logo") + "/images/logo.png"</small>';
84
  $html .= '</td></tr>';
85
  $html .= '</table>';
86
  echo $html;
3
  * Schema.org Type Organization
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.1.4
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/Organization
62
  /**
63
  * Form Layout Render
64
  *
65
+ * @version 3.1.4
66
  * @since 1.0.0
67
  * @param array $option
68
  */
80
  $html .= '</td></tr>';
81
  $html .= '<tr><th class="require"><label for="logo">logo :</label></th><td>';
82
  $html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
83
+ $html .= '<small>Default : bloginfo("url") + "/images/logo.png"</small>';
84
  $html .= '</td></tr>';
85
  $html .= '</table>';
86
  echo $html;
includes/wp-structuring-display.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Kazuya Takami
6
  * @author Justin Frydman
7
- * @version 3.1.0
8
  * @since 1.0.0
9
  */
10
  class Structuring_Markup_Display {
@@ -20,24 +20,27 @@ class Structuring_Markup_Display {
20
  /**
21
  * Constructor Define.
22
  *
23
- * @since 1.0.0
 
 
24
  */
25
- public function __construct () {
26
  $db = new Structuring_Markup_Admin_Db();
27
- $this->set_schema( $db );
28
  }
29
 
30
  /**
31
  * Setting schema.org
32
  *
33
- * @version 3.1.0
34
  * @since 1.0.0
35
  * @param Structuring_Markup_Admin_Db $db
 
36
  */
37
- private function set_schema ( Structuring_Markup_Admin_Db $db ) {
38
  $structuring_markup_args = $db->get_list_options();
39
 
40
- echo '<!-- Markup (JSON-LD) structured in schema.org START -->' . PHP_EOL;
41
 
42
  $this->get_schema_data( 'all', $structuring_markup_args );
43
  if ( is_home() || is_front_page() ) {
@@ -475,7 +478,7 @@ class Structuring_Markup_Display {
475
  /**
476
  * Setting schema.org LocalBusiness
477
  *
478
- * @version 3.0.4
479
  * @since 2.3.0
480
  * @param array $options
481
  */
@@ -496,6 +499,7 @@ class Structuring_Markup_Display {
496
  "@context" => "http://schema.org",
497
  "@type" => isset( $options['business_type'] ) ? esc_html( $options['business_type'] ) : "",
498
  "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
 
499
  "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : "",
500
  "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : ""
501
  );
@@ -509,6 +513,9 @@ class Structuring_Markup_Display {
509
  } else {
510
  $args['acceptsReservations'] = "False";
511
  }
 
 
 
512
  }
513
 
514
  $address_array["address"] = array(
@@ -580,6 +587,11 @@ class Structuring_Markup_Display {
580
  $args = array_merge( $args, $holiday_array );
581
  }
582
 
 
 
 
 
 
583
  $this->set_schema_json( $args );
584
  }
585
 
4
  *
5
  * @author Kazuya Takami
6
  * @author Justin Frydman
7
+ * @version 3.1.4
8
  * @since 1.0.0
9
  */
10
  class Structuring_Markup_Display {
20
  /**
21
  * Constructor Define.
22
  *
23
+ * @version 3.1.4
24
+ * @since 1.0.0
25
+ * @param string $version
26
  */
27
+ public function __construct ( $version ) {
28
  $db = new Structuring_Markup_Admin_Db();
29
+ $this->set_schema( $db, $version );
30
  }
31
 
32
  /**
33
  * Setting schema.org
34
  *
35
+ * @version 3.1.4
36
  * @since 1.0.0
37
  * @param Structuring_Markup_Admin_Db $db
38
+ * @param string $version
39
  */
40
+ private function set_schema ( Structuring_Markup_Admin_Db $db, $version ) {
41
  $structuring_markup_args = $db->get_list_options();
42
 
43
+ echo '<!-- Markup (JSON-LD) structured in schema.org ver.' . $version . ' START -->' . PHP_EOL;
44
 
45
  $this->get_schema_data( 'all', $structuring_markup_args );
46
  if ( is_home() || is_front_page() ) {
478
  /**
479
  * Setting schema.org LocalBusiness
480
  *
481
+ * @version 3.1.4
482
  * @since 2.3.0
483
  * @param array $options
484
  */
499
  "@context" => "http://schema.org",
500
  "@type" => isset( $options['business_type'] ) ? esc_html( $options['business_type'] ) : "",
501
  "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
502
+ "image" => isset( $options['image'] ) ? esc_html( $options['image'] ) : "",
503
  "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : "",
504
  "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : ""
505
  );
513
  } else {
514
  $args['acceptsReservations'] = "False";
515
  }
516
+ if ( isset( $options['serves_cuisine'] ) && $options['serves_cuisine'] !== '' ) {
517
+ $args['servesCuisine'] = esc_html( $options['serves_cuisine'] );
518
+ }
519
  }
520
 
521
  $address_array["address"] = array(
587
  $args = array_merge( $args, $holiday_array );
588
  }
589
 
590
+ if ( isset( $options['price_range'] ) && $options['price_range'] !== '' ) {
591
+ $price_array["priceRange"] = $options['price_range'];
592
+ $args = array_merge( $args, $price_array );
593
+ }
594
+
595
  $this->set_schema_json( $args );
596
  }
597
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: miiitaka
3
  Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
4
  Requires at least: 4.3.1
5
  Tested up to: 4.6.1
6
- Stable tag: 3.1.3
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
@@ -54,6 +54,10 @@ if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
54
 
55
  == Changelog ==
56
 
 
 
 
 
57
  = 3.1.3 (2016-11-22) =
58
  * Updated : Event Type select item of Schema.org type "Event".
59
  * Updated : Short Code display changed of Schema.org type "BreadcrumbList".
3
  Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
4
  Requires at least: 4.3.1
5
  Tested up to: 4.6.1
6
+ Stable tag: 3.1.4
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 3.1.4 (2016-11-25) =
58
+ * Added : Schema.org type "LocalBusiness" item added. "Image", "priceRange" and "servesCuisine".
59
+ * Added : Print plugin version in comments.
60
+
61
  = 3.1.3 (2016-11-22) =
62
  * Updated : Event Type select item of Schema.org type "Event".
63
  * Updated : Short Code display changed of Schema.org type "BreadcrumbList".
wp-structuring-markup.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://wordpress.org/plugins/wp-structuring-markup/
5
  Description: Allows you to include schema.org JSON-LD syntax markup on your website
6
- Version: 3.1.3
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
@@ -18,7 +18,7 @@ new Structuring_Markup();
18
  * Schema.org Basic Class
19
  *
20
  * @author Kazuya Takami
21
- * @version 3.1.3
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
@@ -26,11 +26,11 @@ class Structuring_Markup {
26
  /**
27
  * Variable definition.
28
  *
29
- * @version 3.1.3
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
- private $version = '3.1.3';
34
 
35
  /**
36
  * Constructor Define.
@@ -232,13 +232,13 @@ class Structuring_Markup {
232
  /**
233
  * Display Page Template Require.
234
  *
235
- * @version 2.4.2
236
  * @since 1.3.0
237
  */
238
  public function wp_head () {
239
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-cache.php' );
240
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-opening-hours.php' );
241
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
242
- new Structuring_Markup_Display();
243
  }
244
  }
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://wordpress.org/plugins/wp-structuring-markup/
5
  Description: Allows you to include schema.org JSON-LD syntax markup on your website
6
+ Version: 3.1.4
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
18
  * Schema.org Basic Class
19
  *
20
  * @author Kazuya Takami
21
+ * @version 3.1.4
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
26
  /**
27
  * Variable definition.
28
  *
29
+ * @version 3.1.4
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
+ private $version = '3.1.4';
34
 
35
  /**
36
  * Constructor Define.
232
  /**
233
  * Display Page Template Require.
234
  *
235
+ * @version 3.1.4
236
  * @since 1.3.0
237
  */
238
  public function wp_head () {
239
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-cache.php' );
240
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-opening-hours.php' );
241
  require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
242
+ new Structuring_Markup_Display( $this->version );
243
  }
244
  }