Version Description
- Fixed: Revert to truncate headline to 110 characters, avoid markup error.
Download this release
Release Info
Developer | hishaman |
Plugin | Schema |
Version | 1.7.8.6 |
Comparing to | |
See all releases |
Code changes from version 1.7.8.4 to 1.7.8.6
- includes/extensions/comment.php +30 -12
- readme.txt +9 -2
- schema.php +2 -2
includes/extensions/comment.php
CHANGED
@@ -10,6 +10,34 @@
|
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
add_filter( 'schema_output', 'schema_wp_do_comment' );
|
14 |
/**
|
15 |
* Add Schema Comment for Article types via schema_output filter
|
@@ -19,9 +47,6 @@ add_filter( 'schema_output', 'schema_wp_do_comment' );
|
|
19 |
*/
|
20 |
function schema_wp_do_comment( $schema ) {
|
21 |
|
22 |
-
if ( empty($schema) )
|
23 |
-
return;
|
24 |
-
|
25 |
$comments_enable = schema_wp_get_option( 'comments_enable' );
|
26 |
|
27 |
if ( $comments_enable != true )
|
@@ -33,18 +58,11 @@ function schema_wp_do_comment( $schema ) {
|
|
33 |
$support_article_types = schema_wp_get_support_article_types();
|
34 |
$number = apply_filters( 'schema_wp_do_comment_number', '10'); // default = 10
|
35 |
|
36 |
-
|
37 |
-
//
|
38 |
-
if ( in_array( $schema_type, $support_article_types, true ) ) {
|
39 |
$Comments = schema_wp_get_comments();
|
40 |
-
if ( !
|
41 |
$schema["comment"] = $Comments;
|
42 |
}
|
43 |
-
|
44 |
-
// Add comments number
|
45 |
-
//
|
46 |
-
if ( in_array( $schema_type, $support_article_types, false ) )
|
47 |
-
$schema["commentCount"] = get_comments_number($post->ID);
|
48 |
|
49 |
return $schema;
|
50 |
}
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
12 |
|
13 |
+
|
14 |
+
add_filter( 'schema_output', 'schema_wp_do_comments_number' );
|
15 |
+
/**
|
16 |
+
* Add comments number for Article types via schema_output filter
|
17 |
+
*
|
18 |
+
* @since 1.5.3
|
19 |
+
* @return array
|
20 |
+
*/
|
21 |
+
function schema_wp_do_comments_number( $schema ) {
|
22 |
+
|
23 |
+
$comments_enable = schema_wp_get_option( 'comments_enable' );
|
24 |
+
|
25 |
+
if ( $comments_enable != true )
|
26 |
+
return $schema;
|
27 |
+
|
28 |
+
global $post;
|
29 |
+
|
30 |
+
$schema_type = $schema["@type"];
|
31 |
+
|
32 |
+
$support_article_types = schema_wp_get_support_article_types();
|
33 |
+
|
34 |
+
if ( in_array( $schema_type, $support_article_types, false) )
|
35 |
+
$schema["commentCount"] = get_comments_number($post->ID);
|
36 |
+
|
37 |
+
return $schema;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
add_filter( 'schema_output', 'schema_wp_do_comment' );
|
42 |
/**
|
43 |
* Add Schema Comment for Article types via schema_output filter
|
47 |
*/
|
48 |
function schema_wp_do_comment( $schema ) {
|
49 |
|
|
|
|
|
|
|
50 |
$comments_enable = schema_wp_get_option( 'comments_enable' );
|
51 |
|
52 |
if ( $comments_enable != true )
|
58 |
$support_article_types = schema_wp_get_support_article_types();
|
59 |
$number = apply_filters( 'schema_wp_do_comment_number', '10'); // default = 10
|
60 |
|
61 |
+
if ( in_array( $schema_type, $support_article_types, true) ) {
|
|
|
|
|
62 |
$Comments = schema_wp_get_comments();
|
63 |
+
if ( !empty($Comments) )
|
64 |
$schema["comment"] = $Comments;
|
65 |
}
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
return $schema;
|
68 |
}
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: hishaman, schemapress
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
|
4 |
Tags: schema, schema.org, rich snippets, structured data, json-ld, json, google, seo, markup, search engine, search, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 5.6
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.7.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -223,6 +223,13 @@ Yes, Schema plugin will detect AMP plugin and output a more complete and valid s
|
|
223 |
|
224 |
== Changelog ==
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
= 1.7.8.4 =
|
227 |
* Fixed: PHP notice when calling comments markup function.
|
228 |
* Fixed: BlogPosting markup was missing post id parameter.
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
|
4 |
Tags: schema, schema.org, rich snippets, structured data, json-ld, json, google, seo, markup, search engine, search, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 5.6.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.7.8.6
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
223 |
|
224 |
== Changelog ==
|
225 |
|
226 |
+
= 1.7.8.6 =
|
227 |
+
* Fixed: Revert to truncate headline to 110 characters, avoid markup error.
|
228 |
+
|
229 |
+
= 1.7.8.5 =
|
230 |
+
* Fixed: Use full headline instead of truncated version.
|
231 |
+
* Update: Pumped tested WordPress version to 5.6.1 release.
|
232 |
+
|
233 |
= 1.7.8.4 =
|
234 |
* Fixed: PHP notice when calling comments markup function.
|
235 |
* Fixed: BlogPosting markup was missing post id parameter.
|
schema.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: The next generation of Structured Data.
|
6 |
* Author: Hesham
|
7 |
* Author URI: http://zebida.com
|
8 |
-
* Version: 1.7.8.
|
9 |
* Text Domain: schema-wp
|
10 |
* Domain Path: /languages
|
11 |
* License: GPLv2 or later
|
@@ -52,7 +52,7 @@ final class Schema_WP {
|
|
52 |
*
|
53 |
* @since 1.0
|
54 |
*/
|
55 |
-
private $version = '1.7.8.
|
56 |
|
57 |
/**
|
58 |
* The settings instance variable
|
5 |
* Description: The next generation of Structured Data.
|
6 |
* Author: Hesham
|
7 |
* Author URI: http://zebida.com
|
8 |
+
* Version: 1.7.8.6
|
9 |
* Text Domain: schema-wp
|
10 |
* Domain Path: /languages
|
11 |
* License: GPLv2 or later
|
52 |
*
|
53 |
* @since 1.0
|
54 |
*/
|
55 |
+
private $version = '1.7.8.6';
|
56 |
|
57 |
/**
|
58 |
* The settings instance variable
|