Contextual Related Posts - Version 3.0.7

Version Description

Release post: https://webberzone.com/blog/contextual-related-posts-v3-0-0/

  • Bug fix:
    • Replicate old style of exclusion checking of option set in meta. Using the shortcode, manual or block will ignore the meta option to "Disable Related Posts display"
Download this release

Release Info

Developer Ajay
Plugin Icon 128x128 Contextual Related Posts
Version 3.0.7
Comparing to
See all releases

Code changes from version 3.0.6 to 3.0.7

contextual-related-posts.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Contextual Related Posts
16
  * Plugin URI: https://webberzone.com/plugins/contextual-related-posts/
17
  * Description: Display a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
18
- * Version: 3.0.6
19
  * Author: WebberZone
20
  * Author URI: https://webberzone.com
21
  * License: GPL-2.0+
@@ -38,7 +38,7 @@ if ( ! defined( 'WPINC' ) ) {
38
  * @var string Contextual Related Posts Version.
39
  */
40
  if ( ! defined( 'CRP_VERSION' ) ) {
41
- define( 'CRP_VERSION', '3.0.6' );
42
  }
43
 
44
 
15
  * Plugin Name: Contextual Related Posts
16
  * Plugin URI: https://webberzone.com/plugins/contextual-related-posts/
17
  * Description: Display a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
18
+ * Version: 3.0.7
19
  * Author: WebberZone
20
  * Author URI: https://webberzone.com
21
  * License: GPL-2.0+
38
  * @var string Contextual Related Posts Version.
39
  */
40
  if ( ! defined( 'CRP_VERSION' ) ) {
41
+ define( 'CRP_VERSION', '3.0.7' );
42
  }
43
 
44
 
includes/content.php CHANGED
@@ -34,7 +34,7 @@ add_action( 'template_redirect', 'crp_content_prepare_filter' );
34
  */
35
  function crp_content_filter( $content ) {
36
 
37
- global $post;
38
 
39
  // Return if it's not in the loop or in the main query.
40
  if ( ! in_the_loop() && ! is_main_query() ) {
@@ -52,7 +52,7 @@ function crp_content_filter( $content ) {
52
  }
53
 
54
  // Check exclusions.
55
- if ( crp_exclude_on( $post ) ) {
56
  return $content; // Exit without adding related posts.
57
  }
58
 
34
  */
35
  function crp_content_filter( $content ) {
36
 
37
+ global $post, $crp_settings;
38
 
39
  // Return if it's not in the loop or in the main query.
40
  if ( ! in_the_loop() && ! is_main_query() ) {
52
  }
53
 
54
  // Check exclusions.
55
+ if ( crp_exclude_on( $post, $crp_settings ) ) {
56
  return $content; // Exit without adding related posts.
57
  }
58
 
includes/main-query.php CHANGED
@@ -58,7 +58,7 @@ function get_crp( $args = array() ) {
58
  }
59
 
60
  // Check exclusions.
61
- if ( crp_exclude_on( $post ) ) {
62
  return ''; // Exit without adding related posts.
63
  }
64
 
58
  }
59
 
60
  // Check exclusions.
61
+ if ( crp_exclude_on( $post, $args ) ) {
62
  return ''; // Exit without adding related posts.
63
  }
64
 
includes/modules/exclusions.php CHANGED
@@ -86,16 +86,20 @@ function crp_exclude_on( $post = null, $args = array() ) {
86
  }
87
 
88
  // If the DO NOT DISPLAY meta field is set.
89
- $crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
90
-
91
- if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
92
- $crp_disable_here = $crp_post_meta['crp_disable_here'];
93
- } else {
94
- $crp_disable_here = 0;
95
- }
 
 
 
96
 
97
- if ( $crp_disable_here ) {
98
- return true;
 
99
  }
100
 
101
  return false;
86
  }
87
 
88
  // If the DO NOT DISPLAY meta field is set.
89
+ if ( ( isset( $args['is_shortcode'] ) && ! $args['is_shortcode'] ) &&
90
+ ( isset( $args['is_manual'] ) && ! $args['is_manual'] ) &&
91
+ ( isset( $args['is_block'] ) && ! $args['is_block'] ) ) {
92
+ $crp_post_meta = get_post_meta( $post->ID, 'crp_post_meta', true );
93
+
94
+ if ( isset( $crp_post_meta['crp_disable_here'] ) ) {
95
+ $crp_disable_here = $crp_post_meta['crp_disable_here'];
96
+ } else {
97
+ $crp_disable_here = 0;
98
+ }
99
 
100
+ if ( $crp_disable_here ) {
101
+ return true;
102
+ }
103
  }
104
 
105
  return false;
languages/contextual-related-posts-en_US.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Contextual Related Posts\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2021-02-27 19:43+0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza\n"
8
  "Language-Team: WebberZone\n"
2
  msgstr ""
3
  "Project-Id-Version: Contextual Related Posts\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2021-03-02 10:41+0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza\n"
8
  "Language-Team: WebberZone\n"
languages/contextual-related-posts-en_US.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Contextual Related Posts\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2021-02-27 19:43+0000\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza\n"
9
  "Language-Team: WebberZone\n"
3
  msgstr ""
4
  "Project-Id-Version: Contextual Related Posts\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2021-03-02 10:41+0000\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza\n"
9
  "Language-Team: WebberZone\n"
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Tags: related posts, related, related articles, contextual related posts, similar posts, related posts widget
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
- Stable tag: 3.0.6
6
  Requires at least: 5.0
7
- Tested up to: 5.7
8
- Requires PHP: 5.6
9
  License: GPLv2 or later
10
 
11
  Add related posts to your WordPress site with inbuilt caching. Supports thumbnails, shortcodes, widgets and custom post types!
@@ -174,10 +174,15 @@ You can insert the related posts anywhere in your post using the `[crp]` shortco
174
 
175
  == Changelog ==
176
 
177
- = 3.0.6 =
178
 
179
  Release post: [https://webberzone.com/blog/contextual-related-posts-v3-0-0/](https://webberzone.com/blog/contextual-related-posts-v3-0-0/)
180
 
 
 
 
 
 
181
  * Enhancement:
182
  * Defining `CRP_CACHE_TIME` to `false` will disable expiry
183
  * Introduced wpml-config.xml file. Title and Custom text for blank output can now be translated with Polylang (and potentially WPML)
@@ -252,5 +257,5 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
252
 
253
  == Upgrade Notice ==
254
 
255
- = 3.0.6 =
256
  Bug fixes. Please read the release post on https://webberzone.com
2
  Tags: related posts, related, related articles, contextual related posts, similar posts, related posts widget
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
+ Stable tag: 3.0.7
6
  Requires at least: 5.0
7
+ Tested up to: 5.8
8
+ Requires PHP: 7.0
9
  License: GPLv2 or later
10
 
11
  Add related posts to your WordPress site with inbuilt caching. Supports thumbnails, shortcodes, widgets and custom post types!
174
 
175
  == Changelog ==
176
 
177
+ = 3.0.7 =
178
 
179
  Release post: [https://webberzone.com/blog/contextual-related-posts-v3-0-0/](https://webberzone.com/blog/contextual-related-posts-v3-0-0/)
180
 
181
+ * Bug fix:
182
+ * Replicate old style of exclusion checking of option set in meta. Using the shortcode, manual or block will ignore the meta option to "Disable Related Posts display"
183
+
184
+ = 3.0.6 =
185
+
186
  * Enhancement:
187
  * Defining `CRP_CACHE_TIME` to `false` will disable expiry
188
  * Introduced wpml-config.xml file. Title and Custom text for blank output can now be translated with Polylang (and potentially WPML)
257
 
258
  == Upgrade Notice ==
259
 
260
+ = 3.0.7 =
261
  Bug fixes. Please read the release post on https://webberzone.com