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

Version Description

(2018-06-16) = * Checked : WordPress version 4.9.6 operation check. * Updated : Enable / disable function of link setting of current page of breadcrumbs.

Download this release

Release Info

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

Code changes from version 4.2.2 to 4.3.0

includes/admin/wp-structuring-admin-db.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Admin DB Connection.
4
  *
5
  * @author Kazuya Takami
6
- * @version 4.1.1
7
  * @since 1.0.0
8
  */
9
  class Structuring_Markup_Admin_Db {
@@ -45,7 +45,7 @@ class Structuring_Markup_Admin_Db {
45
  /**
46
  * Create Table.
47
  *
48
- * @version 4.1.1
49
  * @since 1.0.0
50
  * @param string $text_domain
51
  * @param string $version
@@ -77,7 +77,7 @@ class Structuring_Markup_Admin_Db {
77
  /**
78
  * version up process.
79
  *
80
- * @version 4.1.1
81
  * @since 2.0.0
82
  * */
83
  $options = get_option( $text_domain );
@@ -102,9 +102,9 @@ class Structuring_Markup_Admin_Db {
102
  $activate = isset( $list->activate ) ? $list->activate : "";
103
 
104
  // version up default value setting.
105
- if ( $version >= '4.1.1' && $key === 'breadcrumb' ) {
106
  $works = unserialize( $list->options );
107
- $works['current_on'] = 'on';
108
  $list->options = serialize( $works );
109
  }
110
 
3
  * Schema.org Admin DB Connection.
4
  *
5
  * @author Kazuya Takami
6
+ * @version 4.3.0
7
  * @since 1.0.0
8
  */
9
  class Structuring_Markup_Admin_Db {
45
  /**
46
  * Create Table.
47
  *
48
+ * @version 4.3.0
49
  * @since 1.0.0
50
  * @param string $text_domain
51
  * @param string $version
77
  /**
78
  * version up process.
79
  *
80
+ * @version 4.3.0
81
  * @since 2.0.0
82
  * */
83
  $options = get_option( $text_domain );
102
  $activate = isset( $list->activate ) ? $list->activate : "";
103
 
104
  // version up default value setting.
105
+ if ( $version === '4.3.0' && $key === 'breadcrumb' ) {
106
  $works = unserialize( $list->options );
107
+ $works['current_link'] = 'on';
108
  $list->options = serialize( $works );
109
  }
110
 
includes/admin/wp-structuring-admin-type-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Type Breadcrumb
4
  *
5
  * @author Kazuya Takami
6
- * @version 4.1.1
7
  * @since 2.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/BreadcrumbList
@@ -32,7 +32,7 @@ class Structuring_Markup_Type_Breadcrumb {
32
  /**
33
  * Form Layout Render
34
  *
35
- * @version 4.1.1
36
  * @since 2.3.3
37
  * @param array $option
38
  */
@@ -59,6 +59,14 @@ class Structuring_Markup_Type_Breadcrumb {
59
  $html .= '>Enabled';
60
  $html .= '<small>Installed the Current Page to breadcrumbs.</small>';
61
  $html .= '</td></tr>';
 
 
 
 
 
 
 
 
62
  $html .= '</table>';
63
  echo $html;
64
 
@@ -78,14 +86,15 @@ class Structuring_Markup_Type_Breadcrumb {
78
  /**
79
  * Return the default options array
80
  *
81
- * @version 4.1.1
82
  * @since 2.0.0
83
  * @return array $args
84
  */
85
  private function get_default_options () {
86
- $args['home_on'] = '';
87
- $args['home_name'] = '';
88
- $args['current_on'] = '';
 
89
 
90
  return (array) $args;
91
  }
3
  * Schema.org Type Breadcrumb
4
  *
5
  * @author Kazuya Takami
6
+ * @version 4.3.0
7
  * @since 2.0.0
8
  * @see wp-structuring-admin-db.php
9
  * @link https://schema.org/BreadcrumbList
32
  /**
33
  * Form Layout Render
34
  *
35
+ * @version 4.3.0
36
  * @since 2.3.3
37
  * @param array $option
38
  */
59
  $html .= '>Enabled';
60
  $html .= '<small>Installed the Current Page to breadcrumbs.</small>';
61
  $html .= '</td></tr>';
62
+ $html .= '<tr><th><label for="current_link">Current Page Link :</label></th><td>';
63
+ $html .= '<input type="checkbox" name="option[' . "current_link" . ']" id="current_link" value="on"';
64
+ if ( isset( $option['current_link'] ) && $option['current_link'] === 'on' ) {
65
+ $html .= ' checked="checked"';
66
+ }
67
+ $html .= '>Enabled';
68
+ $html .= '<small>Link setting of the current page of breadcrumbs.</small>';
69
+ $html .= '</td></tr>';
70
  $html .= '</table>';
71
  echo $html;
72
 
86
  /**
87
  * Return the default options array
88
  *
89
+ * @version 4.3.0
90
  * @since 2.0.0
91
  * @return array $args
92
  */
93
  private function get_default_options () {
94
+ $args['home_on'] = '';
95
+ $args['home_name'] = '';
96
+ $args['current_on'] = '';
97
+ $args['current_link'] = '';
98
 
99
  return (array) $args;
100
  }
includes/wp-structuring-short-code-breadcrumb.php CHANGED
@@ -3,7 +3,7 @@
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
- * @version 4.2.2
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
@@ -11,7 +11,7 @@ class Structuring_Markup_ShortCode_Breadcrumb {
11
  /**
12
  * ShortCode Display.
13
  *
14
- * @version 2.3.1
15
  * @since 2.0.0
16
  * @access public
17
  * @param array $options
@@ -45,12 +45,20 @@ class Structuring_Markup_ShortCode_Breadcrumb {
45
  $html .= '<ol>';
46
  }
47
  $html .= PHP_EOL;
 
 
 
48
  foreach ( $item_array as $item ) {
49
  $html .= '<li>';
50
- $html .= '<a href="' . esc_url( $item['@id'] ) . '">';
51
- $html .= esc_html( $item['name'] );
52
- $html .= '</a>';
 
 
 
 
53
  $html .= '</li>' . PHP_EOL;
 
54
  }
55
  $html .= '</ol>' . PHP_EOL;
56
  $html .= '<!-- Markup (JSON-LD) structured in schema.org Breadcrumb END -->' . PHP_EOL;
3
  * Breadcrumb ShortCode Settings
4
  *
5
  * @author Kazuya Takami
6
+ * @version 4.3.0
7
  * @since 2.0.0
8
  */
9
  class Structuring_Markup_ShortCode_Breadcrumb {
11
  /**
12
  * ShortCode Display.
13
  *
14
+ * @version 4.3.0
15
  * @since 2.0.0
16
  * @access public
17
  * @param array $options
45
  $html .= '<ol>';
46
  }
47
  $html .= PHP_EOL;
48
+
49
+ $count = 1;
50
+ $length = count( $item_array );
51
  foreach ( $item_array as $item ) {
52
  $html .= '<li>';
53
+ if ( $count === $length && ( !isset( $options['current_link'] ) || $options['current_link'] !== 'on' ) ) {
54
+ $html .= esc_html( $item['name'] );
55
+ } else {
56
+ $html .= '<a href="' . esc_url( $item['@id'] ) . '">';
57
+ $html .= esc_html( $item['name'] );
58
+ $html .= '</a>';
59
+ }
60
  $html .= '</li>' . PHP_EOL;
61
+ $count++;
62
  }
63
  $html .= '</ol>' . PHP_EOL;
64
  $html .= '<!-- Markup (JSON-LD) structured in schema.org Breadcrumb END -->' . PHP_EOL;
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.5
6
- Stable tag: 4.2.2
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.2.2 (2018-05-15) =
58
  * Checked : WordPress version 4.9.5 operation check.
59
  * Fixed : If there is a child element on that page in the top fixed page, the parent element duplicates.
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.6
6
+ Stable tag: 4.3.0
7
 
8
  Allows you to include schema.org JSON-LD syntax markup on your website
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 4.3.0 (2018-06-16) =
58
+ * Checked : WordPress version 4.9.6 operation check.
59
+ * Updated : Enable / disable function of link setting of current page of breadcrumbs.
60
+
61
  = 4.2.2 (2018-05-15) =
62
  * Checked : WordPress version 4.9.5 operation check.
63
  * Fixed : If there is a child element on that page in the top fixed page, the parent element duplicates.
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.2.2
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.2.2
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.2.2
30
  * @since 1.3.0
31
  */
32
- private $version = '4.2.2';
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.3.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 4.3.0
22
  * @since 1.0.0
23
  */
24
  class Structuring_Markup {
26
  /**
27
  * Variable definition version.
28
  *
29
+ * @version 4.3.0
30
  * @since 1.3.0
31
  */
32
+ private $version = '4.3.0';
33
 
34
  /**
35
  * Variable definition Text Domain.