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

Version Description

(2016-09-27) = * Updated : homeLocation input item of Schema.org type "Person".

Download this release

Release Info

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

Code changes from version 3.1.1 to 3.1.2

includes/wp-structuring-admin-post.php CHANGED
@@ -118,7 +118,7 @@ class Structuring_Markup_Admin_Post {
118
  /**
119
  * Setting Page of the Admin Screen.
120
  *
121
- * @version 3.1.0
122
  * @since 1.0.0
123
  * @param array $options
124
  * @param string $status
@@ -158,7 +158,7 @@ class Structuring_Markup_Admin_Post {
158
  $html .= '<input type="checkbox" name="activate" value="on"';
159
  $html .= ( isset( $options['activate'] ) && $options['activate'] === "on" ) ? ' checked' : '';
160
  $html .= '></td></tr>';
161
- $html .= '<tr><th>' . esc_html__( 'Output On', $this->text_domain ) . ' : </th><td>';
162
  echo $html;
163
 
164
  switch ( $options['type'] ) {
118
  /**
119
  * Setting Page of the Admin Screen.
120
  *
121
+ * @version 3.1.2
122
  * @since 1.0.0
123
  * @param array $options
124
  * @param string $status
158
  $html .= '<input type="checkbox" name="activate" value="on"';
159
  $html .= ( isset( $options['activate'] ) && $options['activate'] === "on" ) ? ' checked' : '';
160
  $html .= '></td></tr>';
161
+ $html .= '<tr><th class="require">' . esc_html__( 'Output On', $this->text_domain ) . ' : </th><td>';
162
  echo $html;
163
 
164
  switch ( $options['type'] ) {
includes/wp-structuring-admin-type-person.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type Person
4
  *
5
  * @author Kazuya Takami
6
- * @version 3.0.5
7
  * @since 2.4.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/Person
@@ -40,16 +40,19 @@ class Structuring_Markup_Type_Person {
40
  */
41
  public function __construct ( array $option ) {
42
  /** Default Value Set */
43
- if ( empty( $option ) ) {
44
- $option = $this->get_default_options( $option );
 
 
45
  }
46
- $this->page_render( $option );
 
47
  }
48
 
49
  /**
50
  * Form Layout Render
51
  *
52
- * @version 3.0.5
53
  * @since 2.4.0
54
  * @param array $option
55
  */
@@ -68,6 +71,16 @@ class Structuring_Markup_Type_Person {
68
  $html .= '</table>';
69
  echo $html;
70
 
 
 
 
 
 
 
 
 
 
 
71
  /** Social Profiles */
72
  $html = '<table class="schema-admin-table">';
73
  $html .= '<caption>Social Profiles</caption>';
@@ -86,14 +99,14 @@ class Structuring_Markup_Type_Person {
86
  /**
87
  * Return the default options array
88
  *
89
- * @since 2.4.0
90
  * @version 2.4.0
91
- * @param array $args
92
  * @return array $args
93
  */
94
- private function get_default_options ( array $args ) {
95
- $args['name'] = get_bloginfo('name');
96
- $args['url'] = get_bloginfo('url');
 
97
 
98
  foreach ( $this->social_array as $value ) {
99
  $args['social'][$value['type']] = '';
3
  * Schema.org Type Person
4
  *
5
  * @author Kazuya Takami
6
+ * @version 3.1.2
7
  * @since 2.4.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/Person
40
  */
41
  public function __construct ( array $option ) {
42
  /** Default Value Set */
43
+ $option_array = $this->get_default_options();
44
+
45
+ if ( !empty( $option ) ) {
46
+ $option_array = array_merge( $option_array, $option );
47
  }
48
+
49
+ $this->page_render( $option_array );
50
  }
51
 
52
  /**
53
  * Form Layout Render
54
  *
55
+ * @version 3.1.2
56
  * @since 2.4.0
57
  * @param array $option
58
  */
71
  $html .= '</table>';
72
  echo $html;
73
 
74
+ /** Place Settings */
75
+ $html = '<table class="schema-admin-table">';
76
+ $html .= '<caption>Place Settings</caption>';
77
+ $html .= '<tr><th class="require"><label for="addressCountry">addressCountry :</label></th><td>';
78
+ $html .= '<input type="text" name="option[' . "addressCountry" . ']" id="addressCountry" class="regular-text" required value="' . esc_attr( $option['addressCountry'] ) . '">';
79
+ $html .= '<small>e.g. Japan</small>';
80
+ $html .= '</td></tr>';
81
+ $html .= '</table>';
82
+ echo $html;
83
+
84
  /** Social Profiles */
85
  $html = '<table class="schema-admin-table">';
86
  $html .= '<caption>Social Profiles</caption>';
99
  /**
100
  * Return the default options array
101
  *
102
+ * @since 3.1.2
103
  * @version 2.4.0
 
104
  * @return array $args
105
  */
106
+ private function get_default_options () {
107
+ $args['name'] = get_bloginfo('name');
108
+ $args['url'] = get_bloginfo('url');
109
+ $args['addressCountry'] = '';
110
 
111
  foreach ( $this->social_array as $value ) {
112
  $args['social'][$value['type']] = '';
includes/wp-structuring-display.php CHANGED
@@ -693,7 +693,7 @@ class Structuring_Markup_Display {
693
  /**
694
  * Setting schema.org Person
695
  *
696
- * @version 3.0.4
697
  * @since 2.4.0
698
  * @param array $options
699
  */
@@ -706,6 +706,18 @@ class Structuring_Markup_Display {
706
  "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : ""
707
  );
708
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  /** Social Profiles */
710
  if ( isset( $options['social'] ) ) {
711
  $socials["sameAs"] = array();
693
  /**
694
  * Setting schema.org Person
695
  *
696
+ * @version 3.1.2
697
  * @since 2.4.0
698
  * @param array $options
699
  */
706
  "url" => isset( $options['url'] ) ? esc_url( $options['url'] ) : ""
707
  );
708
 
709
+ /** Place */
710
+ if ( isset( $options['addressCountry'] ) ) {
711
+ $place["homeLocation"] = array(
712
+ "@type" => "Place",
713
+ "address" => array(
714
+ "@type" => "PostalAddress",
715
+ "addressCountry" => $options['addressCountry']
716
+ )
717
+ );
718
+ $args = array_merge( $args, $place );
719
+ }
720
+
721
  /** Social Profiles */
722
  if ( isset( $options['social'] ) ) {
723
  $socials["sameAs"] = array();
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.1
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
@@ -54,7 +54,10 @@ if ( shortcode_exists( 'wp-structuring-markup-breadcrumb' ) ) {
54
 
55
  == Changelog ==
56
 
57
- = 3.1.0 (2016-09-20) =
 
 
 
58
  * Added : Schema.org type "SiteNavigation".
59
  * Checked : WordPress version 4.6.1 operation check.
60
  * Updated : Application URL input item of Schema.org type "WebSite".
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.2
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 3.1.2 (2016-09-27) =
58
+ * Updated : homeLocation input item of Schema.org type "Person".
59
+
60
+ = 3.1.1 (2016-09-20) =
61
  * Added : Schema.org type "SiteNavigation".
62
  * Checked : WordPress version 4.6.1 operation check.
63
  * Updated : Application URL input item of Schema.org type "WebSite".
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.1
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.0
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.1
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
- private $version = '3.1.1';
34
 
35
  /**
36
  * Constructor Define.
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.2
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.2
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
26
  /**
27
  * Variable definition.
28
  *
29
+ * @version 3.1.2
30
  * @since 1.3.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
+ private $version = '3.1.2';
34
 
35
  /**
36
  * Constructor Define.