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

Version Description

(2017-01-30) = * Fixed : Invalid breadcrumb markup. * Fixed : Some items are not displayed on "Organization schema.org". * Added : Add items to e-mail to "Organization schema.org". * Checked : WordPress version 4.7.2 operation check.

Download this release

Release Info

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

Code changes from version 3.1.7 to 3.2.0

includes/wp-structuring-admin-type-organization.php CHANGED
@@ -62,7 +62,7 @@ class Structuring_Markup_Type_Organization {
62
  /**
63
  * Form Layout Render
64
  *
65
- * @version 3.1.4
66
  * @since 1.0.0
67
  * @param array $option
68
  */
@@ -111,18 +111,22 @@ class Structuring_Markup_Type_Organization {
111
  $html .= '</select>';
112
  $html .= '<small>Default : "customer service"</small>';
113
  $html .= '</td></tr>';
 
 
 
 
114
  $html .= '<tr><th><label for="area_served">areaServed :</label></th><td>';
115
  $html .= '<input type="text" name="option[' . "area_served" . ']" id="area_served" class="regular-text" value="' . esc_attr( $option['area_served'] ) . '">';
116
  $html .= '<small>Default : "US"&nbsp;&nbsp;Multiple : "US,CA"</small>';
117
  $html .= '</td></tr>';
118
  $html .= '<tr><th>contactOption :</th><td>';
119
  $html .= '<label><input type="checkbox" name="option[' . "contact_point_1" . ']" id="contact_point_1" value="on"';
120
- if ( isset( $option['contact_point_1'] ) && $option['contact_point_1'] === 'on' ) {
121
  $html .= ' checked="checked"';
122
  }
123
  $html .= '>HearingImpairedSupported</label><br>';
124
  $html .= '<label><input type="checkbox" name="option[' . "contact_point_2" . ']" id="contact_point_2" value="on"';
125
- if ( isset( $option['contact_point_2'] ) && $option['contact_point_2'] === 'on' ) {
126
  $html .= ' checked="checked"';
127
  }
128
  $html .= '>TollFree</label><br>';
@@ -152,8 +156,8 @@ class Structuring_Markup_Type_Organization {
152
  /**
153
  * Return the default options array
154
  *
 
155
  * @since 1.0.0
156
- * @version 2.3.0
157
  * @param array $args
158
  * @return array $args
159
  */
@@ -164,6 +168,7 @@ class Structuring_Markup_Type_Organization {
164
  $args['contact_point'] = '';
165
  $args['telephone'] = '';
166
  $args['contact_type'] = 'customer_service';
 
167
  $args['area_served'] = 'US';
168
  $args['contact_option_1'] = '';
169
  $args['contact_option_2'] = '';
62
  /**
63
  * Form Layout Render
64
  *
65
+ * @version 3.2.0
66
  * @since 1.0.0
67
  * @param array $option
68
  */
111
  $html .= '</select>';
112
  $html .= '<small>Default : "customer service"</small>';
113
  $html .= '</td></tr>';
114
+ $html .= '<tr><th><label for="email">email :</label></th><td>';
115
+ $html .= '<input type="email" name="option[' . "email" . ']" id="email" class="regular-text" value="' . esc_attr( $option['email'] ) . '">';
116
+ $html .= '<small>e.g. : info@example.com</small>';
117
+ $html .= '</td></tr>';
118
  $html .= '<tr><th><label for="area_served">areaServed :</label></th><td>';
119
  $html .= '<input type="text" name="option[' . "area_served" . ']" id="area_served" class="regular-text" value="' . esc_attr( $option['area_served'] ) . '">';
120
  $html .= '<small>Default : "US"&nbsp;&nbsp;Multiple : "US,CA"</small>';
121
  $html .= '</td></tr>';
122
  $html .= '<tr><th>contactOption :</th><td>';
123
  $html .= '<label><input type="checkbox" name="option[' . "contact_point_1" . ']" id="contact_point_1" value="on"';
124
+ if ( isset( $option['contact_point_1'] ) && $option['contact_point_1'] === 'on' ) {
125
  $html .= ' checked="checked"';
126
  }
127
  $html .= '>HearingImpairedSupported</label><br>';
128
  $html .= '<label><input type="checkbox" name="option[' . "contact_point_2" . ']" id="contact_point_2" value="on"';
129
+ if ( isset( $option['contact_point_2'] ) && $option['contact_point_2'] === 'on' ) {
130
  $html .= ' checked="checked"';
131
  }
132
  $html .= '>TollFree</label><br>';
156
  /**
157
  * Return the default options array
158
  *
159
+ * @version 3.2.0
160
  * @since 1.0.0
 
161
  * @param array $args
162
  * @return array $args
163
  */
168
  $args['contact_point'] = '';
169
  $args['telephone'] = '';
170
  $args['contact_type'] = 'customer_service';
171
+ $args['email'] = '';
172
  $args['area_served'] = 'US';
173
  $args['contact_option_1'] = '';
174
  $args['contact_option_2'] = '';
includes/wp-structuring-display.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Kazuya Takami
6
  * @author Justin Frydman
7
- * @version 3.1.6
8
  * @since 1.0.0
9
  */
10
  class Structuring_Markup_Display {
@@ -660,7 +660,7 @@ class Structuring_Markup_Display {
660
  /**
661
  * Setting schema.org Organization
662
  *
663
- * @version 3.0.0
664
  * @since 1.0.0
665
  * @param array $options
666
  */
@@ -676,13 +676,29 @@ class Structuring_Markup_Display {
676
 
677
  /** Corporate Contact */
678
  if ( isset( $options['contact_point'] ) && $options['contact_point'] === 'on' ) {
679
- $contact_point["contactPoint"] = array(
680
- array(
681
- "@type" => "ContactPoint",
682
- "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : "",
683
- "contactType" => isset( $options['contact_type'] ) ? esc_html( $options['contact_type'] ) : ""
684
- )
685
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
  $args = array_merge( $args, $contact_point );
687
  }
688
 
4
  *
5
  * @author Kazuya Takami
6
  * @author Justin Frydman
7
+ * @version 3.2.0
8
  * @since 1.0.0
9
  */
10
  class Structuring_Markup_Display {
660
  /**
661
  * Setting schema.org Organization
662
  *
663
+ * @version 3.2.0
664
  * @since 1.0.0
665
  * @param array $options
666
  */
676
 
677
  /** Corporate Contact */
678
  if ( isset( $options['contact_point'] ) && $options['contact_point'] === 'on' ) {
679
+ $contact_point_data = array(
680
+ "@type" => "ContactPoint",
681
+ "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : "",
682
+ "contactType" => isset( $options['contact_type'] ) ? esc_html( $options['contact_type'] ) : ""
 
 
683
  );
684
+
685
+ if ( !empty( $options['email'] ) ) {
686
+ $contact_point_data['email'] = isset( $options['email'] ) ? esc_html( $options['email'] ) : "";
687
+ }
688
+ if ( !empty( $options['area_served'] ) ) {
689
+ $contact_point_data['areaServed'][] = isset( $options['area_served'] ) ? esc_html( $options['area_served'] ) : "";
690
+ }
691
+ if ( isset( $options['contact_point_1'] ) && $options['contact_point_1'] === 'on' ) {
692
+ $contact_point_data['contactOption'][] = 'HearingImpairedSupported';
693
+ }
694
+ if ( isset( $options['contact_point_2'] ) && $options['contact_point_2'] === 'on' ) {
695
+ $contact_point_data['contactOption'][] = 'TollFree';
696
+ }
697
+ if ( !empty( $options['available_language'] ) ) {
698
+ $contact_point_data['availableLanguage'][] = isset( $options['available_language'] ) ? esc_html( $options['available_language'] ) : "";
699
+ }
700
+
701
+ $contact_point["contactPoint"] = array( $contact_point_data );
702
  $args = array_merge( $args, $contact_point );
703
  }
704
 
includes/wp-structuring-short-code-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
- * @version 2.3.1
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
@@ -62,7 +62,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
62
  /**
63
  * Breadcrumb array setting.
64
  *
65
- * @version 2.2.1
66
  * @since 2.0.0
67
  * @access public
68
  * @param array $options
@@ -122,7 +122,9 @@ class Structuring_Markup_ShortCode_Breadcrumb {
122
  } elseif ( is_404() ) {
123
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, '404 Not Found' );
124
  } elseif ( is_post_type_archive() ) {
125
- $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), post_type_archive_title( '', false ) );
 
 
126
  } elseif ( is_archive() ) {
127
  $taxonomies = get_the_taxonomies( $post->ID );
128
  if ( !empty( $taxonomies ) ) {
@@ -134,7 +136,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
134
  }
135
  }
136
  } elseif ( is_singular( 'post' ) ) {
137
- $categories = get_the_category($post->ID);
138
  if ( isset( $categories[0] ) ) {
139
  $cat = $categories[0];
140
 
@@ -148,7 +150,9 @@ class Structuring_Markup_ShortCode_Breadcrumb {
148
  }
149
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
150
  } elseif ( is_single() ) {
151
- $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), get_post_type_object( get_post_type() )->label );
 
 
152
  $taxonomies = get_the_taxonomies( $post->ID );
153
  if ( !empty( $taxonomies ) ) {
154
  foreach ( array_keys( $taxonomies ) as $key ) {
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.2.0
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
62
  /**
63
  * Breadcrumb array setting.
64
  *
65
+ * @version 3.2.0
66
  * @since 2.0.0
67
  * @access public
68
  * @param array $options
122
  } elseif ( is_404() ) {
123
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, '404 Not Found' );
124
  } elseif ( is_post_type_archive() ) {
125
+ if ( get_post_type_archive_link( get_post_type() ) ) {
126
+ $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), post_type_archive_title( '', false) );
127
+ }
128
  } elseif ( is_archive() ) {
129
  $taxonomies = get_the_taxonomies( $post->ID );
130
  if ( !empty( $taxonomies ) ) {
136
  }
137
  }
138
  } elseif ( is_singular( 'post' ) ) {
139
+ $categories = get_the_category( $post->ID );
140
  if ( isset( $categories[0] ) ) {
141
  $cat = $categories[0];
142
 
150
  }
151
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
152
  } elseif ( is_single() ) {
153
+ if ( get_post_type_archive_link( get_post_type() ) ) {
154
+ $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), get_post_type_object( get_post_type() )->label );
155
+ }
156
  $taxonomies = get_the_taxonomies( $post->ID );
157
  if ( !empty( $taxonomies ) ) {
158
  foreach ( array_keys( $taxonomies ) as $key ) {
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.7.1
6
- Stable tag: 3.1.7
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
@@ -54,6 +54,12 @@ if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
57
  = 3.1.7 (2017-01-12) =
58
  * Checked : WordPress version 4.7.1 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.7.2
6
+ Stable tag: 3.2.0
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 3.2.0 (2017-01-30) =
58
+ * Fixed : Invalid breadcrumb markup.
59
+ * Fixed : Some items are not displayed on "Organization schema.org".
60
+ * Added : Add items to e-mail to "Organization schema.org".
61
+ * Checked : WordPress version 4.7.2 operation check.
62
+
63
  = 3.1.7 (2017-01-12) =
64
  * Checked : WordPress version 4.7.1 operation check.
65
 
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: 3.1.7
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 3.1.7
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.7
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
- private $version = '3.1.7';
34
 
35
  /**
36
  * Constructor Define.
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: 3.2.0
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 3.2.0
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
26
  /**
27
  * Variable definition.
28
  *
29
+ * @version 3.2.0
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
+ private $version = '3.2.0';
34
 
35
  /**
36
  * Constructor Define.