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

Version Description

  • Added : Schema.org type "BlogPosting".
Download this release

Release Info

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

Code changes from version 1.1.3 to 1.2.0

readme.txt CHANGED
@@ -1,16 +1,16 @@
1
  === Markup (JSON-LD) structured in schema.org ===
2
  Contributors: miiitaka
3
- Tags: schema, json, seo, posts
4
  Requires at least: 4.3.1
5
  Tested up to: 4.3.1
6
- Stable tag: 1.1.3
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
9
 
10
  == Description ==
11
 
12
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
13
- Base knowledge is "https://developers.google.com/structured-data/"
14
 
15
  [ Schema.org Type ]
16
 
@@ -26,8 +26,11 @@ Base knowledge is "https://developers.google.com/structured-data/"
26
 
27
  * http://schema.org/Article
28
 
29
- = NewsArticle =
30
 
 
 
 
31
  * http://schema.org/NewsArticle
32
 
33
  == Installation ==
@@ -39,6 +42,10 @@ Base knowledge is "https://developers.google.com/structured-data/"
39
 
40
  == Changelog ==
41
 
 
 
 
 
42
  = 1.1.3 =
43
 
44
  * Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
1
  === Markup (JSON-LD) structured in schema.org ===
2
  Contributors: miiitaka
3
+ Tags: schema, json, seo, post, posts, google,
4
  Requires at least: 4.3.1
5
  Tested up to: 4.3.1
6
+ Stable tag: 1.2.0
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
9
 
10
  == Description ==
11
 
12
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
13
+ Base knowledge is "https://schema.org/" and "https://developers.google.com/structured-data/"
14
 
15
  [ Schema.org Type ]
16
 
26
 
27
  * http://schema.org/Article
28
 
29
+ = BlogPosting =
30
 
31
+ * http://schema.org/BlogPosting
32
+
33
+ == Installation ==
34
  * http://schema.org/NewsArticle
35
 
36
  == Installation ==
42
 
43
  == Changelog ==
44
 
45
+ = 1.2.0 =
46
+
47
+ * Added : Schema.org type "BlogPosting".
48
+
49
  = 1.1.3 =
50
 
51
  * Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
wp-structuring-admin-list.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Admin List
4
  *
5
  * @author Kazuya Takami
6
- * @version 1.1.0
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  */
@@ -13,6 +13,7 @@ class Structuring_Markup_Admin_List {
13
  "website" => "Web Site",
14
  "organization" => "Organization",
15
  "article" => "Article",
 
16
  "news_article" => "News Article"
17
  );
18
 
3
  * Schema.org Admin List
4
  *
5
  * @author Kazuya Takami
6
+ * @version 1.2.0
7
  * @since 1.0.0
8
  * @see wp-structuring-admin-db.php
9
  */
13
  "website" => "Web Site",
14
  "organization" => "Organization",
15
  "article" => "Article",
16
+ "blog_posting" => "Blog Posting",
17
  "news_article" => "News Article"
18
  );
19
 
wp-structuring-admin-post.php CHANGED
@@ -3,7 +3,7 @@
3
  * Schema.org Admin Post
4
  *
5
  * @author Kazuya Takami
6
- * @version 1.1.0
7
  * @since 1.0.0
8
  */
9
  class Structuring_Markup_Admin_Post {
@@ -13,6 +13,7 @@ class Structuring_Markup_Admin_Post {
13
  array("type" => "website", "display" => "Web Site"),
14
  array("type" => "organization", "display" => "Organization"),
15
  array("type" => "article", "display" => "Article"),
 
16
  array("type" => "news_article", "display" => "News Article")
17
  );
18
 
@@ -97,7 +98,7 @@ class Structuring_Markup_Admin_Post {
97
  * Setting Page of the Admin Screen.
98
  *
99
  * @since 1.0.0
100
- * @version 1.1.0
101
  * @param array $options
102
  * @param string $mode
103
  * @param string $status
@@ -181,6 +182,14 @@ class Structuring_Markup_Admin_Post {
181
  require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-article.php' );
182
  new Structuring_Markup_Type_Article();
183
  break;
 
 
 
 
 
 
 
 
184
  case 'news_article':
185
  $this->output_checkbox_render( $options['output'], "post", "Post", "Post Page" );
186
  $html = '</td></tr></table><hr>';
3
  * Schema.org Admin Post
4
  *
5
  * @author Kazuya Takami
6
+ * @version 1.2.0
7
  * @since 1.0.0
8
  */
9
  class Structuring_Markup_Admin_Post {
13
  array("type" => "website", "display" => "Web Site"),
14
  array("type" => "organization", "display" => "Organization"),
15
  array("type" => "article", "display" => "Article"),
16
+ array("type" => "blog_posting", "display" => "Blog Posting"),
17
  array("type" => "news_article", "display" => "News Article")
18
  );
19
 
98
  * Setting Page of the Admin Screen.
99
  *
100
  * @since 1.0.0
101
+ * @version 1.2.0
102
  * @param array $options
103
  * @param string $mode
104
  * @param string $status
182
  require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-article.php' );
183
  new Structuring_Markup_Type_Article();
184
  break;
185
+ case 'blog_posting':
186
+ $this->output_checkbox_render( $options['output'], "post", "Post", "Post Page" );
187
+ $html = '</td></tr></table><hr>';
188
+ echo $html;
189
+
190
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-blog-posting.php' );
191
+ new Structuring_Markup_Type_Blog_Posting();
192
+ break;
193
  case 'news_article':
194
  $this->output_checkbox_render( $options['output'], "post", "Post", "Post Page" );
195
  $html = '</td></tr></table><hr>';
wp-structuring-admin-type-blog-posting.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type BlogPosting
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.2.0
7
+ * @since 1.2.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link http://schema.org/BlogPosting
10
+ */
11
+ class Structuring_Markup_Type_Blog_Posting {
12
+
13
+ /**
14
+ * Constructor Define.
15
+ *
16
+ * @since 1.2.0
17
+ */
18
+ public function __construct()
19
+ {
20
+ $this->page_render();
21
+ }
22
+
23
+ /**
24
+ * Form Layout Render
25
+ *
26
+ * @since 1.2.0
27
+ */
28
+ private function page_render()
29
+ {
30
+ $html = '<table class="schema-admin-table">';
31
+ $html .= '<caption>Basic Setting( Post Page Only )</caption>';
32
+ $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
33
+ $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, ID )</small></td></tr>';
34
+ $html .= '<tr><th>dateModified :</th><td><small>Default : get_the_modified_time( DATE_ISO8601, ID )</small></td></tr>';
35
+ $html .= '<tr><th>author :</th><td><small>Default : get_the_author_meta( "display_name", author_ID )</small></td></tr>';
36
+ $html .= '<tr><th>image :</th><td><small>Default : thumbnail</small></td></tr>';
37
+ $html .= '<tr><th>description :</th><td><small>Default : post_excerpt</small></td></tr>';
38
+ $html .= '<tr><th>articleBody :</th><td><small>Default : post_content</small></td></tr>';
39
+ $html .= '</table>';
40
+ echo $html;
41
+
42
+ submit_button();
43
+ }
44
+ }
wp-structuring-display.php CHANGED
@@ -41,7 +41,7 @@ class Structuring_Markup_Display {
41
  * Setting JSON-LD Template
42
  *
43
  * @since 1.0.0
44
- * @version 1.1.3
45
  * @param Structuring_Markup_Admin_Db $db
46
  * @param string $output
47
  */
@@ -67,6 +67,11 @@ class Structuring_Markup_Display {
67
  $this->set_schema_article();
68
  }
69
  break;
 
 
 
 
 
70
  case 'news_article':
71
  if ( isset( $row->options ) ) {
72
  $this->set_schema_news_article();
@@ -194,6 +199,31 @@ class Structuring_Markup_Display {
194
  }
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  /**
198
  * Setting schema.org NewsArticle
199
  *
41
  * Setting JSON-LD Template
42
  *
43
  * @since 1.0.0
44
+ * @version 1.2.0
45
  * @param Structuring_Markup_Admin_Db $db
46
  * @param string $output
47
  */
67
  $this->set_schema_article();
68
  }
69
  break;
70
+ case 'blog_posting':
71
+ if ( isset( $row->options ) ) {
72
+ $this->set_schema_blog_posting();
73
+ }
74
+ break;
75
  case 'news_article':
76
  if ( isset( $row->options ) ) {
77
  $this->set_schema_news_article();
199
  }
200
  }
201
 
202
+ /**
203
+ * Setting schema.org BlogPosting
204
+ *
205
+ * @since 1.2.0
206
+ * @version 1.2.0
207
+ */
208
+ private function set_schema_blog_posting() {
209
+ global $post;
210
+ if ( has_post_thumbnail( $post->ID ) ) {
211
+ $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
212
+ $args = array(
213
+ "@context" => "http://schema.org",
214
+ "@type" => "BlogPosting",
215
+ "headline" => $this->escape_text_tags( $post->post_title ),
216
+ "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
217
+ "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ),
218
+ "author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
219
+ "image" => array( $images[0] ),
220
+ "description" => $this->escape_text_tags( $post->post_excerpt ),
221
+ "articleBody" => $this->escape_text_tags( $post->post_content )
222
+ );
223
+ $this->set_schema_json( $args );
224
+ }
225
+ }
226
+
227
  /**
228
  * Setting schema.org NewsArticle
229
  *
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: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
- Version: 1.1.3
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://github.com/miiitaka/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: 1.2.0
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later