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

Version Description

(2015-12-21) =

  • Fixed : Breadcrumb ShortCode minor bug fixed.
Download this release

Release Info

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

Code changes from version 2.2.0 to 2.2.1

includes/wp-structuring-custom-post-event.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Kazuya Takami
6
  * @since 2.1.0
7
- * @version 2.1.3
8
  */
9
  class Structuring_Markup_Custom_Post_Event {
10
 
@@ -21,7 +21,7 @@ class Structuring_Markup_Custom_Post_Event {
21
  * Constructor Define.
22
  *
23
  * @since 2.1.0
24
- * @version 2.1.3
25
  * @param String $text_domain
26
  */
27
  public function __construct ( $text_domain ) {
@@ -40,7 +40,7 @@ class Structuring_Markup_Custom_Post_Event {
40
  'menu_position' => 5,
41
  'public' => true,
42
  'query_var' => false,
43
- 'rewrite' => array( 'slug' => 'events' ),
44
  'show_in_menu' => true,
45
  'show_ui' => true,
46
  'supports' => array( 'title', 'editor', 'author', 'thumbnail' )
4
  *
5
  * @author Kazuya Takami
6
  * @since 2.1.0
7
+ * @version 2.2.1
8
  */
9
  class Structuring_Markup_Custom_Post_Event {
10
 
21
  * Constructor Define.
22
  *
23
  * @since 2.1.0
24
+ * @version 2.2.1
25
  * @param String $text_domain
26
  */
27
  public function __construct ( $text_domain ) {
40
  'menu_position' => 5,
41
  'public' => true,
42
  'query_var' => false,
43
+ 'rewrite' => array( 'with_front' => true, 'slug' => 'events' ),
44
  'show_in_menu' => true,
45
  'show_ui' => true,
46
  'supports' => array( 'title', 'editor', 'author', 'thumbnail' )
includes/wp-structuring-short-code-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
- * @version 2.1.0
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
@@ -40,7 +40,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
40
  /**
41
  * Breadcrumb array setting.
42
  *
43
- * @version 2.1.0
44
  * @since 2.0.0
45
  * @access public
46
  * @param array $options
@@ -97,9 +97,23 @@ class Structuring_Markup_ShortCode_Breadcrumb {
97
  $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $post->post_parent ), get_the_title( $post->post_parent ) );
98
  }
99
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
100
- } elseif ( is_single() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  $categories = get_the_category($post->ID);
102
- if ( isset($categories[0]) ) {
103
  $cat = $categories[0];
104
 
105
  if ( $cat->parent !== 0 ) {
@@ -108,7 +122,19 @@ class Structuring_Markup_ShortCode_Breadcrumb {
108
  $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $ancestor ), get_cat_name( $ancestor ) );
109
  }
110
  }
111
- $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $cat->term_id ), $cat->name);
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
114
  }
@@ -127,7 +153,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
127
  */
128
  private function set_schema_breadcrumb_item ( $id, $name ) {
129
  $args = array(
130
- "@id" => esc_html( $id ),
131
  "name" => esc_html( $name )
132
  );
133
  return (array) $args;
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
+ * @version 2.2.1
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
40
  /**
41
  * Breadcrumb array setting.
42
  *
43
+ * @version 2.2.1
44
  * @since 2.0.0
45
  * @access public
46
  * @param array $options
97
  $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $post->post_parent ), get_the_title( $post->post_parent ) );
98
  }
99
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
100
+ } elseif ( is_404() ) {
101
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, '404 Not Found' );
102
+ } elseif ( is_post_type_archive() ) {
103
+ $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), post_type_archive_title( '', false ) );
104
+ } elseif ( is_archive() ) {
105
+ $taxonomies = get_the_taxonomies( $post->ID );
106
+ if ( !empty( $taxonomies ) ) {
107
+ foreach ( array_keys( $taxonomies ) as $key ) {
108
+ $terms = get_the_terms( $post->ID, $key );
109
+ for ( $i = 0; $i < count( $terms ); $i++) {
110
+ $item_array[] = $this->set_schema_breadcrumb_item( get_term_link( $terms[$i]->term_id, $key ), $terms[$i]->name );
111
+ }
112
+ }
113
+ }
114
+ } elseif ( is_singular( 'post' ) ) {
115
  $categories = get_the_category($post->ID);
116
+ if ( isset( $categories[0] ) ) {
117
  $cat = $categories[0];
118
 
119
  if ( $cat->parent !== 0 ) {
122
  $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $ancestor ), get_cat_name( $ancestor ) );
123
  }
124
  }
125
+ $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $cat->term_id ), $cat->name );
126
+ }
127
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
128
+ } elseif ( is_single() ) {
129
+ $item_array[] = $this->set_schema_breadcrumb_item( get_post_type_archive_link( get_post_type() ), get_post_type_object( get_post_type() )->label );
130
+ $taxonomies = get_the_taxonomies( $post->ID );
131
+ if ( !empty( $taxonomies ) ) {
132
+ foreach ( array_keys( $taxonomies ) as $key ) {
133
+ $terms = get_the_terms( $post->ID, $key );
134
+ for ( $i = 0; $i < count( $terms ); $i++) {
135
+ $item_array[] = $this->set_schema_breadcrumb_item( get_term_link( $terms[$i]->term_id, $key ), $terms[$i]->name );
136
+ }
137
+ }
138
  }
139
  $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
140
  }
153
  */
154
  private function set_schema_breadcrumb_item ( $id, $name ) {
155
  $args = array(
156
+ "@id" => esc_url( $id ),
157
  "name" => esc_html( $name )
158
  );
159
  return (array) $args;
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.4
6
- Stable tag: 2.2.0
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
9
 
@@ -44,6 +44,10 @@ if (shortcode_exists('wp-structuring-markup-breadcrumb')) {
44
 
45
  == Changelog ==
46
 
 
 
 
 
47
  = 2.2.0 (2015-12-16) =
48
 
49
  * Updated : Updated on December 14, 2015 was structured data (Article) AMP correspondence. https://developers.google.com/structured-data/rich-snippets/articles?hl=ja
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.4
6
+ Stable tag: 2.2.1
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
9
 
44
 
45
  == Changelog ==
46
 
47
+ = 2.2.1 (2015-12-21) =
48
+
49
+ * Fixed : Breadcrumb ShortCode minor bug fixed.
50
+
51
  = 2.2.0 (2015-12-16) =
52
 
53
  * Updated : Updated on December 14, 2015 was structured data (Article) AMP correspondence. https://developers.google.com/structured-data/rich-snippets/articles?hl=ja
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: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
- Version: 2.2.0
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
@@ -19,7 +19,7 @@ new Structuring_Markup();
19
  *
20
  * @author Kazuya Takami
21
  * @since 1.0.0
22
- * @version 2.1.1
23
  */
24
  class Structuring_Markup {
25
 
@@ -27,10 +27,10 @@ class Structuring_Markup {
27
  * Variable definition.
28
  *
29
  * @since 1.3.0
30
- * @version 2.1.1
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
- private $version = '2.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: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
+ Version: 2.2.1
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
19
  *
20
  * @author Kazuya Takami
21
  * @since 1.0.0
22
+ * @version 2.2.0
23
  */
24
  class Structuring_Markup {
25
 
27
  * Variable definition.
28
  *
29
  * @since 1.3.0
30
+ * @version 2.2.0
31
  */
32
  private $text_domain = 'wp-structuring-markup';
33
+ private $version = '2.2.0';
34
 
35
  /**
36
  * Constructor Define.