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

Version Description

(2017-12-12) = * Checked : WordPress version 4.9.1 operation check. * Fixed : Hidden if addressRegion and telephone is empty.

Download this release

Release Info

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

Code changes from version 4.1.5 to 4.1.6

includes/meta/wp-structuring-meta-local-business.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type LocalBusiness
4
  *
5
  * @author Kazuya Takami
6
- * @version 4.0.0
7
  * @since 4.0.0
8
  * @see wp-structuring-opening-hours.php
9
  * @link http://schema.org/LocalBusiness
@@ -15,7 +15,7 @@ class Structuring_Markup_Meta_LocalBusiness {
15
  /**
16
  * Setting schema.org LocalBusiness
17
  *
18
- * @version 4.0.0
19
  * @since 4.0.0
20
  * @param array $options
21
  * @return array $args
@@ -38,10 +38,13 @@ class Structuring_Markup_Meta_LocalBusiness {
38
  "@type" => isset( $options['business_type'] ) ? esc_html( $options['business_type'] ) : "",
39
  "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
40
  "image" => isset( $options['image'] ) ? esc_html( $options['image'] ) : "",
41
- "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : "",
42
- "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : ""
43
  );
44
 
 
 
 
 
45
  if ( isset( $options['food_active'] ) && $options['food_active'] === 'on' ) {
46
  if ( isset( $options['menu'] ) && $options['menu'] !== '' ) {
47
  $args['menu'] = esc_url( $options['menu'] );
@@ -56,14 +59,18 @@ class Structuring_Markup_Meta_LocalBusiness {
56
  }
57
  }
58
 
59
- $address_array["address"] = array(
60
  "@type" => "PostalAddress",
61
  "streetAddress" => isset( $options['street_address'] ) ? esc_html( $options['street_address'] ) : "",
62
  "addressLocality" => isset( $options['address_locality'] ) ? esc_html( $options['address_locality'] ) : "",
63
- "addressRegion" => isset( $options['address_region'] ) ? esc_html( $options['address_region'] ) : "",
64
  "postalCode" => isset( $options['postal_code'] ) ? esc_html( $options['postal_code'] ) : "",
65
  "addressCountry" => isset( $options['address_country'] ) ? esc_html( $options['address_country'] ) : ""
66
  );
 
 
 
 
 
67
  $args = array_merge( $args, $address_array );
68
  $geo_array = array();
69
 
@@ -125,7 +132,7 @@ class Structuring_Markup_Meta_LocalBusiness {
125
  $args = array_merge( $args, $holiday_array );
126
  }
127
 
128
- if ( isset( $options['price_range'] ) && $options['price_range'] !== '' ) {
129
  $price_array["priceRange"] = $options['price_range'];
130
  $args = array_merge( $args, $price_array );
131
  }
3
  * Schema.org Type LocalBusiness
4
  *
5
  * @author Kazuya Takami
6
+ * @version 4.1.6
7
  * @since 4.0.0
8
  * @see wp-structuring-opening-hours.php
9
  * @link http://schema.org/LocalBusiness
15
  /**
16
  * Setting schema.org LocalBusiness
17
  *
18
+ * @version 4.1.6
19
  * @since 4.0.0
20
  * @param array $options
21
  * @return array $args
38
  "@type" => isset( $options['business_type'] ) ? esc_html( $options['business_type'] ) : "",
39
  "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
40
  "image" => isset( $options['image'] ) ? esc_html( $options['image'] ) : "",
41
+ "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : ""
 
42
  );
43
 
44
+ if ( isset( $options['telephone'] ) && !empty( $options['telephone'] ) ) {
45
+ $args['telephone'] = esc_html( $options['telephone'] );
46
+ }
47
+
48
  if ( isset( $options['food_active'] ) && $options['food_active'] === 'on' ) {
49
  if ( isset( $options['menu'] ) && $options['menu'] !== '' ) {
50
  $args['menu'] = esc_url( $options['menu'] );
59
  }
60
  }
61
 
62
+ $address_array['address'] = array(
63
  "@type" => "PostalAddress",
64
  "streetAddress" => isset( $options['street_address'] ) ? esc_html( $options['street_address'] ) : "",
65
  "addressLocality" => isset( $options['address_locality'] ) ? esc_html( $options['address_locality'] ) : "",
 
66
  "postalCode" => isset( $options['postal_code'] ) ? esc_html( $options['postal_code'] ) : "",
67
  "addressCountry" => isset( $options['address_country'] ) ? esc_html( $options['address_country'] ) : ""
68
  );
69
+
70
+ if ( isset( $options['address_region'] ) && !empty( $options['address_region'] ) ) {
71
+ $address_array['address']['addressRegion'] = esc_html( $options['address_region'] );
72
+ }
73
+
74
  $args = array_merge( $args, $address_array );
75
  $geo_array = array();
76
 
132
  $args = array_merge( $args, $holiday_array );
133
  }
134
 
135
+ if ( isset( $options['price_range'] ) && !empty( $options['price_range'] ) ) {
136
  $price_array["priceRange"] = $options['price_range'];
137
  $args = array_merge( $args, $price_array );
138
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.9.0
6
- Stable tag: 4.1.5
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
  = 4.1.5 (2017-11-22) =
58
  * Checked : WordPress version 4.9.0 operation check.
59
 
2
  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.9.1
6
+ Stable tag: 4.1.6
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 4.1.6 (2017-12-12) =
58
+ * Checked : WordPress version 4.9.1 operation check.
59
+ * Fixed : Hidden if addressRegion and telephone is empty.
60
+
61
  = 4.1.5 (2017-11-22) =
62
  * Checked : WordPress version 4.9.0 operation check.
63
 
wp-structuring-markup.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://github.com/miiitaka/wp-structuring-markup
5
  Description: Allows you to include schema.org JSON-LD syntax markup on your website
6
- Version: 4.1.5
7
  Author: Kazuya Takami
8
  Author URI: https://www.terakoya.work/
9
  License: GPLv2 or later
@@ -18,7 +18,7 @@ new Structuring_Markup();
18
  * Schema.org Basic Class
19
  *
20
  * @author Kazuya Takami
21
- * @version 4.1.5
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
@@ -26,10 +26,10 @@ class Structuring_Markup {
26
  /**
27
  * Variable definition version.
28
  *
29
- * @version 4.1.5
30
  * @since 1.3.0
31
  */
32
- private $version = '4.1.5';
33
 
34
  /**
35
  * Variable definition Text Domain.
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://github.com/miiitaka/wp-structuring-markup
5
  Description: Allows you to include schema.org JSON-LD syntax markup on your website
6
+ Version: 4.1.6
7
  Author: Kazuya Takami
8
  Author URI: https://www.terakoya.work/
9
  License: GPLv2 or later
18
  * Schema.org Basic Class
19
  *
20
  * @author Kazuya Takami
21
+ * @version 4.1.6
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
26
  /**
27
  * Variable definition version.
28
  *
29
+ * @version 4.1.6
30
  * @since 1.3.0
31
  */
32
+ private $version = '4.1.6';
33
 
34
  /**
35
  * Variable definition Text Domain.