Contextual Related Posts - Version 3.2.0

Version Description

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

  • New feature:

    • New option to limit posts to the primary category/term. The plugin checks if either Yoast, Rank Math, The SEO Framework or SEOPress are active. If none of these are active, the plugin will pick the first category provided by get_the_terms()
    • New option to show the primary category/term
    • New option in metabox to enter a comma-separated list of post IDs to exclude from the related posts
    • New filter crp_fill_random_posts (default:false) which can be used to fill random posts if the number of related posts is less than the limit set
  • Enhancements/modifications:

    • No widget is displayed if get_crp() is empty i.e. no related posts are found
    • post_title and post_content fields are only used if Use content option is set
    • Gutenberg block updated to the latest Blocks API
    • The widget's "Only from categories" autocomplete replaced by ID list
    • Wrapper div now always includes crp_related class name. Stylesheets have been updated to have more specific styles e.g. .crp_related.crp-rounded-thumbs
    • Exclude categories and Exclude on categories renamed to Exclude terms and Exclude on terms as they now support all taxonomies and the accepted format has changed to "Term Name (taxonomy:term_taxonomy_id)"
  • Bug fixes:

    • Current post was incorrectly being excluded in the translation functions
Download this release

Release Info

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

Code changes from version 3.1.1 to 3.2.0

Files changed (40) hide show
  1. README.md +16 -16
  2. contextual-related-posts.php +4 -4
  3. css/grid.css +8 -7
  4. css/grid.min.css +1 -1
  5. css/masonry.css +11 -11
  6. css/masonry.min.css +1 -1
  7. css/rounded-thumbs.css +11 -11
  8. css/rounded-thumbs.min.css +1 -1
  9. css/thumbs-grid.css +15 -14
  10. css/thumbs-grid.min.css +1 -1
  11. includes/admin/admin.php +15 -4
  12. includes/admin/blocks/related-posts.php +0 -158
  13. includes/admin/blocks/related-posts/index.js +0 -227
  14. includes/admin/blocks/related-posts/index.min.js +0 -1
  15. includes/admin/blocks/related-posts/index.php +0 -1
  16. includes/admin/default-settings.php +55 -47
  17. includes/admin/js/crp-suggest.js +5 -6
  18. includes/admin/js/crp-suggest.min.js +1 -1
  19. includes/admin/modules/metabox.php +47 -1
  20. includes/admin/save-settings.php +26 -15
  21. includes/admin/settings-page.php +29 -14
  22. includes/{admin/blocks → blocks}/index.php +0 -0
  23. includes/blocks/register-blocks.php +85 -0
  24. includes/blocks/related-posts/block.json +62 -0
  25. includes/blocks/related-posts/build/index.asset.php +1 -0
  26. includes/blocks/related-posts/build/index.js +1 -0
  27. includes/blocks/related-posts/src/edit.js +298 -0
  28. includes/blocks/related-posts/src/index.js +27 -0
  29. includes/class-crp-query.php +124 -13
  30. includes/header.php +12 -2
  31. includes/i10n.php +9 -10
  32. includes/main-query.php +26 -12
  33. includes/media.php +1 -1
  34. includes/modules/class-crp-widget.php +103 -103
  35. includes/modules/exclusions.php +8 -3
  36. includes/output-generator.php +79 -27
  37. includes/tools.php +80 -0
  38. languages/contextual-related-posts-en_US.po +382 -318
  39. languages/contextual-related-posts-en_US.pot +382 -318
  40. readme.txt +25 -4
README.md CHANGED
@@ -6,9 +6,9 @@
6
  [![Required PHP](https://img.shields.io/wordpress/plugin/required-php/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
7
  [![Active installs](https://img.shields.io/wordpress/plugin/installs/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
8
 
9
- __Requires:__ 5.1
10
 
11
- __Tested up to:__ 5.8
12
 
13
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
14
 
@@ -28,26 +28,26 @@ And the default inbuilt styles allow you to switch between gorgeous thumbnail-ri
28
 
29
  ### Key features
30
 
31
- * **Automatic**: CRP will start displaying related posts on your site and feed automatically after the content when you activate the plugin. No need to edit template files
32
- * **Manual install**: Want more control over placement? Check the [FAQ](http://wordpress.org/extend/plugins/contextual-related-posts/faq/) on which functions are available for manual install
33
- * **Gutenberg / Block Editor support**: You can find a block called "Related Posts [CRP]" with its own configurable set of options
34
- * **Widgets**: Add related posts to widgetized area of your theme. Lots of options available
35
- * **Shortcode**: Use `[crp]` to display the posts anywhere you want in the post content
36
- * **REST API**: Fetch related posts at `contextual-related-posts/v1/posts/<id>/`
37
- * **The algorithm**: Find related posts by title and/or content of the current post
38
- * **Caching**: Related posts output is automatically cached as visitors browse through your site
39
- * **Exclusions**: Exclude posts from categories from being displayed in the list. Or you can exclude posts or pages by ID
40
- * **Custom post types**: The related posts list lets you include posts, pages, attachments or any other custom post type!
41
- * **Thumbnail support**:
42
  * Support for WordPress post thumbnails. CRP will create a custom image size (`crp_thumbnail`) with the dimensions specified in the Settings page
43
  * Auto-extract the first image in your post to be displayed as a thumbnail
44
  * Manually enter the URL of the thumbnail via [WordPress meta fields](http://codex.wordpress.org/Custom_Fields). Specify this using the meta box in your Edit screens.
45
  * Optionally, use timthumb to resize images or use your own filter function to resize post images
46
- * **Styles**: The output is wrapped in CSS classes which allows you to easily style the list. You can enter your custom CSS styles from within WordPress Admin area or use the style included.
47
- * **Customisable output**:
48
  * Display excerpts in post. You can select the length of the excerpt in words
49
  * Customise which HTML tags to use for displaying the output in case you don't prefer the default `list` format
50
- * **Extendable code**: CRP has tonnes of filters and actions that allow any developer to easily add features, edit outputs, etc.
51
 
52
  ### mySQL FULLTEXT indices
53
 
6
  [![Required PHP](https://img.shields.io/wordpress/plugin/required-php/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
7
  [![Active installs](https://img.shields.io/wordpress/plugin/installs/contextual-related-posts?style=flat-square)](https://wordpress.org/plugins/contextual-related-posts/)
8
 
9
+ __Requires:__ 5.6
10
 
11
+ __Tested up to:__ 5.9
12
 
13
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
14
 
28
 
29
  ### Key features
30
 
31
+ * __Automatic__: CRP will start displaying related posts on your site and feed automatically after the content when you activate the plugin. No need to edit template files
32
+ * __Manual install__: Want more control over placement? Check the [FAQ](http://wordpress.org/extend/plugins/contextual-related-posts/faq/) on which functions are available for manual install
33
+ * __Gutenberg / Block Editor support__: You can find a block called "Related Posts [CRP]" with its own configurable set of options
34
+ * __Widgets__: Add related posts to widgetized area of your theme. Lots of options available
35
+ * __Shortcode__: Use `[crp]` to display the posts anywhere you want in the post content
36
+ * __REST API__: Fetch related posts at `contextual-related-posts/v1/posts/<id>/`
37
+ * __The algorithm__: Find related posts by title and/or content of the current post
38
+ * __Caching__: Related posts output is automatically cached as visitors browse through your site
39
+ * __Exclusions__: Exclude posts from categories from being displayed in the list. Or you can exclude posts or pages by ID
40
+ * __Custom post types__: The related posts list lets you include posts, pages, attachments or any other custom post type!
41
+ * __Thumbnail support__:
42
  * Support for WordPress post thumbnails. CRP will create a custom image size (`crp_thumbnail`) with the dimensions specified in the Settings page
43
  * Auto-extract the first image in your post to be displayed as a thumbnail
44
  * Manually enter the URL of the thumbnail via [WordPress meta fields](http://codex.wordpress.org/Custom_Fields). Specify this using the meta box in your Edit screens.
45
  * Optionally, use timthumb to resize images or use your own filter function to resize post images
46
+ * __Styles__: The output is wrapped in CSS classes which allows you to easily style the list. You can enter your custom CSS styles from within WordPress Admin area or use the style included.
47
+ * __Customisable output__:
48
  * Display excerpts in post. You can select the length of the excerpt in words
49
  * Customise which HTML tags to use for displaying the output in case you don't prefer the default `list` format
50
+ * __Extendable code__: CRP has tonnes of filters and actions that allow any developer to easily add features, edit outputs, etc.
51
 
52
  ### mySQL FULLTEXT indices
53
 
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.1.1
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.1.0' );
42
  }
43
 
44
 
@@ -122,7 +122,7 @@ require_once CRP_PLUGIN_DIR . 'includes/modules/taxonomies.php';
122
  require_once CRP_PLUGIN_DIR . 'includes/modules/exclusions.php';
123
  require_once CRP_PLUGIN_DIR . 'includes/modules/class-crp-rest-api.php';
124
  require_once CRP_PLUGIN_DIR . 'includes/modules/class-crp-widget.php';
125
- require_once CRP_PLUGIN_DIR . 'includes/admin/blocks/related-posts.php';
126
 
127
 
128
  /*
@@ -155,7 +155,7 @@ require_once CRP_PLUGIN_DIR . 'includes/deprecated.php';
155
  /**
156
  * Global variable holding the current settings for Contextual Related Posts
157
  *
158
- * @since 1.8.10
159
  *
160
  * @var array
161
  */
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.2.0
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.2.0' );
42
  }
43
 
44
 
122
  require_once CRP_PLUGIN_DIR . 'includes/modules/exclusions.php';
123
  require_once CRP_PLUGIN_DIR . 'includes/modules/class-crp-rest-api.php';
124
  require_once CRP_PLUGIN_DIR . 'includes/modules/class-crp-widget.php';
125
+ require_once CRP_PLUGIN_DIR . 'includes/blocks/register-blocks.php';
126
 
127
 
128
  /*
155
  /**
156
  * Global variable holding the current settings for Contextual Related Posts
157
  *
158
+ * @since 1.8.10
159
  *
160
  * @var array
161
  */
css/grid.css CHANGED
@@ -1,29 +1,30 @@
1
- .crp_related {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
- .crp_related h3, .crp_related figure {
6
  margin: 0 !important;
7
  }
8
- .crp_related ul {
9
  display: grid;
10
  gap: 10px;
11
  margin: 0;
12
  justify-items: center;
13
  list-style: none;
 
14
  }
15
- .crp_related ul li {
16
  text-align:left;
17
  word-break: break-word;
18
  }
19
- .crp_related .crp_thumb, .crp_related .crp_title {
20
  display: block;
21
  margin: 0 auto;
22
  }
23
- .crp_related ul li a {
24
  text-decoration: none !important;
25
  }
26
- .crp_related ul li img {
27
  max-width: 100%;
28
  height: auto;
29
  display: block;
1
+ .crp_related.crp-grid {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
+ .crp_related.crp-grid h3, .crp_related.crp-grid figure {
6
  margin: 0 !important;
7
  }
8
+ .crp_related.crp-grid ul {
9
  display: grid;
10
  gap: 10px;
11
  margin: 0;
12
  justify-items: center;
13
  list-style: none;
14
+ padding: 0;
15
  }
16
+ .crp_related.crp-grid ul li {
17
  text-align:left;
18
  word-break: break-word;
19
  }
20
+ .crp_related.crp-grid .crp_thumb, .crp_related.crp-grid .crp_title {
21
  display: block;
22
  margin: 0 auto;
23
  }
24
+ .crp_related.crp-grid ul li a {
25
  text-decoration: none !important;
26
  }
27
+ .crp_related.crp-grid ul li img {
28
  max-width: 100%;
29
  height: auto;
30
  display: block;
css/grid.min.css CHANGED
@@ -1 +1 @@
1
- .crp_related{clear:both;margin:10px 0}.crp_related figure,.crp_related h3{margin:0!important}.crp_related ul{display:grid;gap:10px;margin:0;justify-items:center;list-style:none}.crp_related ul li{text-align:left;word-break:break-word}.crp_related .crp_thumb,.crp_related .crp_title{display:block;margin:0 auto}.crp_related ul li a{text-decoration:none!important}.crp_related ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_clear{clear:both}.crp_author,.crp_date,.crp_excerpt{display:block;font-size:.9em}
1
+ .crp_related.crp-grid{clear:both;margin:10px 0}.crp_related.crp-grid figure,.crp_related.crp-grid h3{margin:0!important}.crp_related.crp-grid ul{display:grid;gap:10px;margin:0;justify-items:center;list-style:none;padding:0}.crp_related.crp-grid ul li{text-align:left;word-break:break-word}.crp_related.crp-grid .crp_thumb,.crp_related.crp-grid .crp_title{display:block;margin:0 auto}.crp_related.crp-grid ul li a{text-decoration:none!important}.crp_related.crp-grid ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_clear{clear:both}.crp_author,.crp_date,.crp_excerpt{display:block;font-size:.9em}
css/masonry.css CHANGED
@@ -23,15 +23,15 @@
23
  to {opacity: 1;}
24
  }
25
 
26
- .crp_related {
27
  width: 100%;
28
  margin: 10px auto;
29
  clear: both;
30
  }
31
- .crp_related h3, .crp_related figure {
32
  margin: 0 !important;
33
  }
34
- .crp_related ul {
35
  margin: 1em 0;
36
  padding: 0;
37
  -moz-column-gap: 1em;
@@ -40,7 +40,7 @@
40
  font-size: .85em;
41
  list-style-type: none;
42
  }
43
- .crp_related ul li {
44
  background: #fff;
45
  padding: 3px;
46
  margin: 0 0 1em;
@@ -63,13 +63,13 @@
63
  text-align: center;
64
  display:inline-block;
65
  }
66
- .crp_related ul li a {
67
  display: block;
68
  text-decoration: none !important;
69
  border: 0;
70
  box-shadow: none;
71
  }
72
- .crp_related ul li .crp_author a {
73
  display: inline;
74
  }
75
  .crp_author, .crp_date, .crp_excerpt {
@@ -81,12 +81,12 @@
81
  margin: .25em 0;
82
  color: #666;
83
  }
84
- .crp_related ul li a:hover {
85
  color: #666;
86
  border-color: #888;
87
  text-decoration: none !important;
88
  }
89
- .crp_related ul li:hover {
90
  box-shadow: 0px 5px 20px 3px rgba(0,0,0,0.1) !important;
91
 
92
  -webkit-transition: all .2s;
@@ -98,20 +98,20 @@
98
  }
99
 
100
  @media only screen and (min-width: 700px) {
101
- .crp_related ul {
102
  -moz-column-count: 2;
103
  -webkit-column-count: 2;
104
  column-count: 2;
105
  }
106
  }
107
  @media only screen and (min-width: 900px) {
108
- .crp_related ul {
109
  -moz-column-count: 3;
110
  -webkit-column-count: 3;
111
  column-count: 3;
112
  }
113
  }
114
- .crp_related ul li img {
115
  max-width: 100%;
116
  height: auto;
117
  display: block;
23
  to {opacity: 1;}
24
  }
25
 
26
+ .crp_related.crp-masonry {
27
  width: 100%;
28
  margin: 10px auto;
29
  clear: both;
30
  }
31
+ .crp_related.crp-masonry h3, .crp_related.crp-masonry figure {
32
  margin: 0 !important;
33
  }
34
+ .crp_related.crp-masonry ul {
35
  margin: 1em 0;
36
  padding: 0;
37
  -moz-column-gap: 1em;
40
  font-size: .85em;
41
  list-style-type: none;
42
  }
43
+ .crp_related.crp-masonry ul li {
44
  background: #fff;
45
  padding: 3px;
46
  margin: 0 0 1em;
63
  text-align: center;
64
  display:inline-block;
65
  }
66
+ .crp_related.crp-masonry ul li a {
67
  display: block;
68
  text-decoration: none !important;
69
  border: 0;
70
  box-shadow: none;
71
  }
72
+ .crp_related.crp-masonry ul li .crp_author a {
73
  display: inline;
74
  }
75
  .crp_author, .crp_date, .crp_excerpt {
81
  margin: .25em 0;
82
  color: #666;
83
  }
84
+ .crp_related.crp-masonry ul li a:hover {
85
  color: #666;
86
  border-color: #888;
87
  text-decoration: none !important;
88
  }
89
+ .crp_related.crp-masonry ul li:hover {
90
  box-shadow: 0px 5px 20px 3px rgba(0,0,0,0.1) !important;
91
 
92
  -webkit-transition: all .2s;
98
  }
99
 
100
  @media only screen and (min-width: 700px) {
101
+ .crp_related.crp-masonry ul {
102
  -moz-column-count: 2;
103
  -webkit-column-count: 2;
104
  column-count: 2;
105
  }
106
  }
107
  @media only screen and (min-width: 900px) {
108
+ .crp_related.crp-masonry ul {
109
  -moz-column-count: 3;
110
  -webkit-column-count: 3;
111
  column-count: 3;
112
  }
113
  }
114
+ .crp_related.crp-masonry ul li img {
115
  max-width: 100%;
116
  height: auto;
117
  display: block;
css/masonry.min.css CHANGED
@@ -1 +1 @@
1
- @keyframes wzslideup{from{transform:translateY(80px)}to{transform:translateY(0)}}@-webkit-keyframes wzslideup{from{-webkit-transform:translateY(80px)}to{-webkit-transform:translateY(0)}}@-moz-keyframes wzslideup{from{-moz-transform:translateY(80px)}to{-moz-transform:translateY(0)}}@-webkit-keyframes wzfadein{from{opacity:0}to{opacity:1}}@-moz-keyframes wzfadein{from{opacity:0}to{opacity:1}}@keyframes wzfadein{from{opacity:0}to{opacity:1}}.crp_related{width:100%;margin:10px auto;clear:both}.crp_related figure,.crp_related h3{margin:0!important}.crp_related ul{margin:1em 0;padding:0;-moz-column-gap:1em;-webkit-column-gap:1em;column-gap:1em;font-size:.85em;list-style-type:none}.crp_related ul li{background:#fff;padding:3px;margin:0 0 1em;width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-shadow:0 1px 1px 0 rgba(0,0,0,.18);border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #efefef;animation:wzslideup .8s ease-out,wzfadein 1s ease-out;-webkit-animation:wzslideup .8s ease-out,wzfadein 1s ease-out;-moz-animation:wzslideup .8s ease-out,wzfadein 1s ease;font-size:1em;text-align:center;display:inline-block}.crp_related ul li a{display:block;text-decoration:none!important;border:0;box-shadow:none}.crp_related ul li .crp_author a{display:inline}.crp_author,.crp_date,.crp_excerpt{display:block;font-size:.9em}.crp_title{display:block;margin:.25em 0;color:#666}.crp_related ul li a:hover{color:#666;border-color:#888;text-decoration:none!important}.crp_related ul li:hover{box-shadow:0 5px 20px 3px rgba(0,0,0,.1)!important;-webkit-transition:all .2s;-webkit-transform:scale(1.03,1.03);-moz-transition:all .2s;-moz-transform:scale(1.03,1.03);transition:all .2s;transform:scale(1.03)}@media only screen and (min-width:700px){.crp_related ul{-moz-column-count:2;-webkit-column-count:2;column-count:2}}@media only screen and (min-width:900px){.crp_related ul{-moz-column-count:3;-webkit-column-count:3;column-count:3}}.crp_related ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_clear{clear:both}
1
+ @keyframes wzslideup{from{transform:translateY(80px)}to{transform:translateY(0)}}@-webkit-keyframes wzslideup{from{-webkit-transform:translateY(80px)}to{-webkit-transform:translateY(0)}}@-moz-keyframes wzslideup{from{-moz-transform:translateY(80px)}to{-moz-transform:translateY(0)}}@-webkit-keyframes wzfadein{from{opacity:0}to{opacity:1}}@-moz-keyframes wzfadein{from{opacity:0}to{opacity:1}}@keyframes wzfadein{from{opacity:0}to{opacity:1}}.crp_related.crp-masonry{width:100%;margin:10px auto;clear:both}.crp_related.crp-masonry figure,.crp_related.crp-masonry h3{margin:0!important}.crp_related.crp-masonry ul{margin:1em 0;padding:0;-moz-column-gap:1em;-webkit-column-gap:1em;column-gap:1em;font-size:.85em;list-style-type:none}.crp_related.crp-masonry ul li{background:#fff;padding:3px;margin:0 0 1em;width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-shadow:0 1px 1px 0 rgba(0,0,0,.18);border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #efefef;animation:wzslideup .8s ease-out,wzfadein 1s ease-out;-webkit-animation:wzslideup .8s ease-out,wzfadein 1s ease-out;-moz-animation:wzslideup .8s ease-out,wzfadein 1s ease;font-size:1em;text-align:center;display:inline-block}.crp_related.crp-masonry ul li a{display:block;text-decoration:none!important;border:0;box-shadow:none}.crp_related.crp-masonry ul li .crp_author a{display:inline}.crp_author,.crp_date,.crp_excerpt{display:block;font-size:.9em}.crp_title{display:block;margin:.25em 0;color:#666}.crp_related.crp-masonry ul li a:hover{color:#666;border-color:#888;text-decoration:none!important}.crp_related.crp-masonry ul li:hover{box-shadow:0 5px 20px 3px rgba(0,0,0,.1)!important;-webkit-transition:all .2s;-webkit-transform:scale(1.03,1.03);-moz-transition:all .2s;-moz-transform:scale(1.03,1.03);transition:all .2s;transform:scale(1.03)}@media only screen and (min-width:700px){.crp_related.crp-masonry ul{-moz-column-count:2;-webkit-column-count:2;column-count:2}}@media only screen and (min-width:900px){.crp_related.crp-masonry ul{-moz-column-count:3;-webkit-column-count:3;column-count:3}}.crp_related.crp-masonry ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_clear{clear:both}
css/rounded-thumbs.css CHANGED
@@ -1,41 +1,41 @@
1
- .crp_related {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
- .crp_related h3, .crp_related figure {
6
  margin: 0 !important;
7
  }
8
- .crp_related ul {
9
  list-style: none;
10
  float: left;
11
  margin: 0 !important;
12
  padding: 0 !important;
13
  }
14
- .crp_related li, .crp_related a {
15
  float: left;
16
  overflow: hidden;
17
  position: relative;
18
  text-align: center;
19
  }
20
- .crp_related li {
21
  margin: 5px !important;
22
  border: 1px solid #ddd;
23
  padding: 6px;
24
  }
25
- .crp_related li:hover {
26
  background: #eee;
27
  border-color: #bbb;
28
  }
29
- .crp_related a {
30
  -webkit-box-shadow: none !important;
31
  -moz-box-shadow: none !important;
32
  box-shadow: none !important;
33
  text-decoration: none !important;
34
  }
35
- .crp_related a:hover {
36
  text-decoration: none;
37
  }
38
- .crp_related .crp_title {
39
  color: #fff !important;
40
  position: absolute;
41
  display: block;
@@ -48,10 +48,10 @@
48
  -moz-border-radius: 7px;
49
  border-radius: 7px;
50
  }
51
- .crp_related li:hover .crp_title {
52
  background-color: rgba(0, 0, 0, 0.8);
53
  }
54
- .crp_related li {
55
  vertical-align: bottom;
56
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4);
57
  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4);
1
+ .crp_related.crp-rounded-thumbs {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
+ .crp_related.crp-rounded-thumbs h3, .crp_related.crp-rounded-thumbs figure {
6
  margin: 0 !important;
7
  }
8
+ .crp_related.crp-rounded-thumbs ul {
9
  list-style: none;
10
  float: left;
11
  margin: 0 !important;
12
  padding: 0 !important;
13
  }
14
+ .crp_related.crp-rounded-thumbs li, .crp_related.crp-rounded-thumbs a {
15
  float: left;
16
  overflow: hidden;
17
  position: relative;
18
  text-align: center;
19
  }
20
+ .crp_related.crp-rounded-thumbs li {
21
  margin: 5px !important;
22
  border: 1px solid #ddd;
23
  padding: 6px;
24
  }
25
+ .crp_related.crp-rounded-thumbs li:hover {
26
  background: #eee;
27
  border-color: #bbb;
28
  }
29
+ .crp_related.crp-rounded-thumbs a {
30
  -webkit-box-shadow: none !important;
31
  -moz-box-shadow: none !important;
32
  box-shadow: none !important;
33
  text-decoration: none !important;
34
  }
35
+ .crp_related.crp-rounded-thumbs a:hover {
36
  text-decoration: none;
37
  }
38
+ .crp_related.crp-rounded-thumbs .crp_title {
39
  color: #fff !important;
40
  position: absolute;
41
  display: block;
48
  -moz-border-radius: 7px;
49
  border-radius: 7px;
50
  }
51
+ .crp_related.crp-rounded-thumbs li:hover .crp_title {
52
  background-color: rgba(0, 0, 0, 0.8);
53
  }
54
+ .crp_related.crp-rounded-thumbs li {
55
  vertical-align: bottom;
56
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4);
57
  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4);
css/rounded-thumbs.min.css CHANGED
@@ -1 +1 @@
1
- .crp_related{clear:both;margin:10px 0}.crp_related figure,.crp_related h3{margin:0!important}.crp_related ul{list-style:none;float:left;margin:0!important;padding:0!important}.crp_related a,.crp_related li{float:left;overflow:hidden;position:relative;text-align:center}.crp_related li{margin:5px!important;border:1px solid #ddd;padding:6px}.crp_related li:hover{background:#eee;border-color:#bbb}.crp_related a{-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;text-decoration:none!important}.crp_related a:hover{text-decoration:none}.crp_related .crp_title{color:#fff!important;position:absolute;display:block;bottom:0;padding:3px;font-size:.9em;text-shadow:.1em .1em .2em #000;background-color:rgba(0,0,0,.5);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.crp_related li:hover .crp_title{background-color:rgba(0,0,0,.8)}.crp_related li{vertical-align:bottom;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.4);-moz-box-shadow:0 1px 2px rgba(0,0,0,.4);box-shadow:0 1px 2px rgba(0,0,0,.4);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;list-style-type:none}.crp_clear{clear:both}.crp_title:visited{color:#fff!important}
1
+ .crp_related.crp-rounded-thumbs{clear:both;margin:10px 0}.crp_related.crp-rounded-thumbs figure,.crp_related.crp-rounded-thumbs h3{margin:0!important}.crp_related.crp-rounded-thumbs ul{list-style:none;float:left;margin:0!important;padding:0!important}.crp_related.crp-rounded-thumbs a,.crp_related.crp-rounded-thumbs li{float:left;overflow:hidden;position:relative;text-align:center}.crp_related.crp-rounded-thumbs li{margin:5px!important;border:1px solid #ddd;padding:6px}.crp_related.crp-rounded-thumbs li:hover{background:#eee;border-color:#bbb}.crp_related.crp-rounded-thumbs a{-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;text-decoration:none!important}.crp_related.crp-rounded-thumbs a:hover{text-decoration:none}.crp_related.crp-rounded-thumbs .crp_title{color:#fff!important;position:absolute;display:block;bottom:0;padding:3px;font-size:.9em;text-shadow:.1em .1em .2em #000;background-color:rgba(0,0,0,.5);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.crp_related.crp-rounded-thumbs li:hover .crp_title{background-color:rgba(0,0,0,.8)}.crp_related.crp-rounded-thumbs li{vertical-align:bottom;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.4);-moz-box-shadow:0 1px 2px rgba(0,0,0,.4);box-shadow:0 1px 2px rgba(0,0,0,.4);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;list-style-type:none}.crp_clear{clear:both}.crp_title:visited{color:#fff!important}
css/thumbs-grid.css CHANGED
@@ -1,41 +1,42 @@
1
- .crp_related {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
- .crp_related h3, .crp_related figure {
6
  margin: 0 !important;
7
  }
8
- .crp_related ul {
9
  display: grid;
10
  grid-gap: 10px;
11
  margin: 0;
12
  justify-items: center;
13
  list-style: none;
 
14
  }
15
- .crp_related ul li {
16
  text-align:center;
17
  border: 1px solid #ddd;
18
  display: flex;
19
  flex-direction: column;
20
  word-break: break-word;
21
  }
22
- .crp_related li:hover {
23
  background: #eee;
24
  border-color: #bbb;
25
  }
26
- .crp_related ul li a.crp_link {
27
  flex-grow: 1;
28
  display: grid;
29
  overflow: hidden;
30
  padding: 3px;
31
  }
32
- .crp_related ul li a.crp_link .crp_thumb {
33
  grid-row-start: 1;
34
  grid-row-end: 3;
35
  grid-column-start: 1;
36
  grid-column-end: 2;
37
  }
38
- .crp_related ul li a.crp_link .crp_title {
39
  display: flex;
40
  justify-content: center;
41
  align-items: center;
@@ -44,22 +45,22 @@
44
  grid-column-start: 1;
45
  grid-column-end: 2;
46
  }
47
- .crp_related a {
48
  -webkit-box-shadow: none !important;
49
  -moz-box-shadow: none !important;
50
  box-shadow: none !important;
51
  text-decoration: none !important;
52
  }
53
- .crp_related a:hover {
54
  text-decoration: none;
55
  }
56
- .crp_related ul li img {
57
  max-width: 100%;
58
  height: auto;
59
  display: block;
60
  margin: 0 auto;
61
  }
62
- .crp_related .crp_title {
63
  color: #fff !important;
64
  padding: 3px;
65
  font-size: .9em;
@@ -72,10 +73,10 @@
72
  overflow: hidden;
73
  line-height: initial;
74
  }
75
- .crp_related li:hover .crp_title {
76
  background-color: rgba(0, 0, 0, 0.8);
77
  }
78
- .crp_related li {
79
  vertical-align: bottom;
80
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4);
81
  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4);
1
+ .crp_related.crp-thumbs-grid {
2
  clear: both;
3
  margin: 10px 0;
4
  }
5
+ .crp_related.crp-thumbs-grid h3, .crp_related.crp-thumbs-grid figure {
6
  margin: 0 !important;
7
  }
8
+ .crp_related.crp-thumbs-grid ul {
9
  display: grid;
10
  grid-gap: 10px;
11
  margin: 0;
12
  justify-items: center;
13
  list-style: none;
14
+ padding: 0;
15
  }
16
+ .crp_related.crp-thumbs-grid ul li {
17
  text-align:center;
18
  border: 1px solid #ddd;
19
  display: flex;
20
  flex-direction: column;
21
  word-break: break-word;
22
  }
23
+ .crp_related.crp-thumbs-grid li:hover {
24
  background: #eee;
25
  border-color: #bbb;
26
  }
27
+ .crp_related.crp-thumbs-grid ul li a.crp_link {
28
  flex-grow: 1;
29
  display: grid;
30
  overflow: hidden;
31
  padding: 3px;
32
  }
33
+ .crp_related.crp-thumbs-grid ul li a.crp_link .crp_thumb {
34
  grid-row-start: 1;
35
  grid-row-end: 3;
36
  grid-column-start: 1;
37
  grid-column-end: 2;
38
  }
39
+ .crp_related.crp-thumbs-grid ul li a.crp_link .crp_title {
40
  display: flex;
41
  justify-content: center;
42
  align-items: center;
45
  grid-column-start: 1;
46
  grid-column-end: 2;
47
  }
48
+ .crp_related.crp-thumbs-grid a {
49
  -webkit-box-shadow: none !important;
50
  -moz-box-shadow: none !important;
51
  box-shadow: none !important;
52
  text-decoration: none !important;
53
  }
54
+ .crp_related.crp-thumbs-grid a:hover {
55
  text-decoration: none;
56
  }
57
+ .crp_related.crp-thumbs-grid ul li img {
58
  max-width: 100%;
59
  height: auto;
60
  display: block;
61
  margin: 0 auto;
62
  }
63
+ .crp_related.crp-thumbs-grid .crp_title {
64
  color: #fff !important;
65
  padding: 3px;
66
  font-size: .9em;
73
  overflow: hidden;
74
  line-height: initial;
75
  }
76
+ .crp_related.crp-thumbs-grid li:hover .crp_title {
77
  background-color: rgba(0, 0, 0, 0.8);
78
  }
79
+ .crp_related.crp-thumbs-grid li {
80
  vertical-align: bottom;
81
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.4);
82
  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.4);
css/thumbs-grid.min.css CHANGED
@@ -1 +1 @@
1
- .crp_related{clear:both;margin:10px 0}.crp_related figure,.crp_related h3{margin:0!important}.crp_related ul{display:grid;grid-gap:10px;margin:0;justify-items:center;list-style:none}.crp_related ul li{text-align:center;border:1px solid #ddd;display:flex;flex-direction:column;word-break:break-word}.crp_related li:hover{background:#eee;border-color:#bbb}.crp_related ul li a.crp_link{flex-grow:1;display:grid;overflow:hidden;padding:3px}.crp_related ul li a.crp_link .crp_thumb{grid-row-start:1;grid-row-end:3;grid-column-start:1;grid-column-end:2}.crp_related ul li a.crp_link .crp_title{display:flex;justify-content:center;align-items:center;grid-row-start:2;grid-row-end:3;grid-column-start:1;grid-column-end:2}.crp_related a{-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;text-decoration:none!important}.crp_related a:hover{text-decoration:none}.crp_related ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_related .crp_title{color:#fff!important;padding:3px;font-size:.9em;text-shadow:.1em .1em .2em #000;background-color:rgba(0,0,0,.5);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;width:100%;overflow:hidden;line-height:initial}.crp_related li:hover .crp_title{background-color:rgba(0,0,0,.8)}.crp_related li{vertical-align:bottom;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.4);-moz-box-shadow:0 1px 2px rgba(0,0,0,.4);box-shadow:0 1px 2px rgba(0,0,0,.4);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;list-style-type:none}.crp_clear{clear:both}.crp_title:visited{color:#fff!important}
1
+ .crp_related.crp-thumbs-grid{clear:both;margin:10px 0}.crp_related.crp-thumbs-grid figure,.crp_related.crp-thumbs-grid h3{margin:0!important}.crp_related.crp-thumbs-grid ul{display:grid;grid-gap:10px;margin:0;justify-items:center;list-style:none;padding:0}.crp_related.crp-thumbs-grid ul li{text-align:center;border:1px solid #ddd;display:flex;flex-direction:column;word-break:break-word}.crp_related.crp-thumbs-grid li:hover{background:#eee;border-color:#bbb}.crp_related.crp-thumbs-grid ul li a.crp_link{flex-grow:1;display:grid;overflow:hidden;padding:3px}.crp_related.crp-thumbs-grid ul li a.crp_link .crp_thumb{grid-row-start:1;grid-row-end:3;grid-column-start:1;grid-column-end:2}.crp_related.crp-thumbs-grid ul li a.crp_link .crp_title{display:flex;justify-content:center;align-items:center;grid-row-start:2;grid-row-end:3;grid-column-start:1;grid-column-end:2}.crp_related.crp-thumbs-grid a{-webkit-box-shadow:none!important;-moz-box-shadow:none!important;box-shadow:none!important;text-decoration:none!important}.crp_related.crp-thumbs-grid a:hover{text-decoration:none}.crp_related.crp-thumbs-grid ul li img{max-width:100%;height:auto;display:block;margin:0 auto}.crp_related.crp-thumbs-grid .crp_title{color:#fff!important;padding:3px;font-size:.9em;text-shadow:.1em .1em .2em #000;background-color:rgba(0,0,0,.5);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;width:100%;overflow:hidden;line-height:initial}.crp_related.crp-thumbs-grid li:hover .crp_title{background-color:rgba(0,0,0,.8)}.crp_related.crp-thumbs-grid li{vertical-align:bottom;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.4);-moz-box-shadow:0 1px 2px rgba(0,0,0,.4);box-shadow:0 1px 2px rgba(0,0,0,.4);-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;list-style-type:none}.crp_clear{clear:both}.crp_title:visited{color:#fff!important}
includes/admin/admin.php CHANGED
@@ -93,15 +93,26 @@ function crp_load_admin_scripts( $hook ) {
93
 
94
  global $crp_settings_page, $crp_settings_tools;
95
 
96
- wp_register_script( 'crp-admin-js', CRP_PLUGIN_URL . 'includes/admin/js/admin-scripts.min.js', array( 'jquery', 'jquery-ui-tabs', 'jquery-ui-datepicker' ), '1.0', true );
97
- wp_register_script( 'crp-suggest-js', CRP_PLUGIN_URL . 'includes/admin/js/crp-suggest.min.js', array( 'jquery', 'jquery-ui-autocomplete' ), '1.0', true );
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
  wp_register_style(
100
  'crp-admin-customizer-css',
101
  CRP_PLUGIN_URL . 'includes/admin/css/crp-customizer.min.css',
102
  false,
103
- '1.0',
104
- false
105
  );
106
 
107
  if ( in_array( $hook, array( $crp_settings_page, $crp_settings_tools ), true ) ) {
93
 
94
  global $crp_settings_page, $crp_settings_tools;
95
 
96
+ wp_register_script(
97
+ 'crp-admin-js',
98
+ CRP_PLUGIN_URL . 'includes/admin/js/admin-scripts.min.js',
99
+ array( 'jquery', 'jquery-ui-tabs', 'jquery-ui-datepicker' ),
100
+ CRP_VERSION,
101
+ true
102
+ );
103
+ wp_register_script(
104
+ 'crp-suggest-js',
105
+ CRP_PLUGIN_URL . 'includes/admin/js/crp-suggest.min.js',
106
+ array( 'jquery', 'jquery-ui-autocomplete' ),
107
+ CRP_VERSION,
108
+ true
109
+ );
110
 
111
  wp_register_style(
112
  'crp-admin-customizer-css',
113
  CRP_PLUGIN_URL . 'includes/admin/css/crp-customizer.min.css',
114
  false,
115
+ CRP_VERSION
 
116
  );
117
 
118
  if ( in_array( $hook, array( $crp_settings_page, $crp_settings_tools ), true ) ) {
includes/admin/blocks/related-posts.php DELETED
@@ -1,158 +0,0 @@
1
- <?php
2
- /**
3
- * Functions to register client-side assets (scripts and stylesheets) for the
4
- * Gutenberg block.
5
- *
6
- * @package Contextual_Related_Posts
7
- */
8
-
9
- /**
10
- * Renders the `contextual-related-posts/related-posts` block on server.
11
- *
12
- * @since 2.8.0
13
- * @param array $attributes The block attributes.
14
- *
15
- * @return string Returns the post content with latest posts added.
16
- */
17
- function render_crp_block( $attributes ) {
18
-
19
- $attributes['extra_class'] = $attributes['className'];
20
-
21
- $arguments = array_merge(
22
- $attributes,
23
- array(
24
- 'is_block' => 1,
25
- )
26
- );
27
-
28
- $arguments = wp_parse_args( $attributes['other_attributes'], $arguments );
29
-
30
- /**
31
- * Filters arguments passed to get_crp for the block.
32
- *
33
- * @since 2.8.0
34
- *
35
- * @param array $arguments CRP block options array.
36
- * @param array $attributes Block attributes array.
37
- */
38
- $arguments = apply_filters( 'crp_block_options', $arguments, $attributes );
39
-
40
- return get_crp( $arguments );
41
- }
42
-
43
- /**
44
- * Registers all block assets so that they can be enqueued through Gutenberg in
45
- * the corresponding context.
46
- *
47
- * @since 2.8.0
48
- */
49
- function crp_block_init() {
50
- global $pagenow;
51
- // Skip block registration if Gutenberg is not enabled/merged.
52
- if ( ! function_exists( 'register_block_type' ) ) {
53
- return;
54
- }
55
- $dir = dirname( __FILE__ );
56
- $file_prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
57
-
58
- $dependencies = array( 'wp-element', 'wp-blocks', 'wp-components', 'wp-i18n' );
59
-
60
- if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ), true ) ) {
61
- array_push( $dependencies, 'wp-editor', 'wp-edit-post', 'wp-block-editor' );
62
- } elseif ( 'widgets.php' === $pagenow ) {
63
- array_push( $dependencies, 'wp-edit-widgets' );
64
- }
65
-
66
- $index_js = "related-posts/index{$file_prefix}.js";
67
- wp_register_script( // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter
68
- 'related-posts-block-editor',
69
- plugins_url( $index_js, __FILE__ ),
70
- $dependencies,
71
- filemtime( "$dir/$index_js" )
72
- );
73
-
74
- // Localize the script with new data.
75
- $localized_variables = array(
76
- 'orderings' => crp_get_orderings(),
77
- );
78
- wp_localize_script( 'related-posts-block-editor', 'crp_php_variables', $localized_variables );
79
-
80
- $style_array = crp_get_style();
81
-
82
- if ( ! empty( $style_array ) ) {
83
- $style = $style_array['name'];
84
- $extra_css = $style_array['extra_css'];
85
-
86
- wp_register_style(
87
- 'related-posts-block-editor',
88
- plugins_url( "css/{$style}.min.css", CRP_PLUGIN_FILE ),
89
- array( 'wp-edit-blocks' ),
90
- '1.0'
91
- );
92
- wp_add_inline_style( 'related-posts-block-editor', $extra_css );
93
- }
94
-
95
- $args = array(
96
- 'editor_script' => 'related-posts-block-editor',
97
- 'render_callback' => 'render_crp_block',
98
- 'attributes' => array(
99
- 'className' => array(
100
- 'type' => 'string',
101
- 'default' => '',
102
- ),
103
- 'heading' => array(
104
- 'type' => 'boolean',
105
- 'default' => false,
106
- ),
107
- 'limit' => array(
108
- 'type' => 'number',
109
- 'default' => 6,
110
- ),
111
- 'offset' => array(
112
- 'type' => 'number',
113
- 'default' => 0,
114
- ),
115
- 'show_excerpt' => array(
116
- 'type' => 'boolean',
117
- 'default' => false,
118
- ),
119
- 'show_author' => array(
120
- 'type' => 'boolean',
121
- 'default' => false,
122
- ),
123
- 'show_date' => array(
124
- 'type' => 'boolean',
125
- 'default' => false,
126
- ),
127
- 'post_thumb_op' => array(
128
- 'type' => 'string',
129
- 'default' => 'inline',
130
- ),
131
- 'ordering' => array(
132
- 'type' => 'string',
133
- 'default' => 'relevance',
134
- ),
135
- 'random_order' => array(
136
- 'type' => 'boolean',
137
- 'default' => false,
138
- ),
139
- 'other_attributes' => array(
140
- 'type' => 'string',
141
- 'default' => '',
142
- ),
143
- ),
144
- );
145
- if ( ! empty( $style ) ) {
146
- $args['editor_style'] = 'related-posts-block-editor';
147
- }
148
-
149
- register_block_type(
150
- 'contextual-related-posts/related-posts',
151
- $args
152
- );
153
-
154
- if ( function_exists( 'wp_set_script_translations' ) ) {
155
- wp_set_script_translations( 'related-posts-block-editor', 'contextual-related-posts' );
156
- }
157
- }
158
- add_action( 'init', 'crp_block_init' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/blocks/related-posts/index.js DELETED
@@ -1,227 +0,0 @@
1
- ( function( blocks, i18n, element, components, editor, blockEditor ) {
2
- var el = element.createElement;
3
- const {registerBlockType} = blocks;
4
- const {__} = i18n; //translation functions
5
- var ServerSideRender = wp.serverSideRender;
6
-
7
- const { RichText, InspectorControls } = blockEditor;
8
- const {
9
- TextControl,
10
- CheckboxControl,
11
- RadioControl,
12
- SelectControl,
13
- TextareaControl,
14
- ToggleControl,
15
- RangeControl,
16
- Panel,
17
- PanelBody,
18
- PanelRow,
19
- } = components;
20
-
21
- registerBlockType( 'contextual-related-posts/related-posts', {
22
- title: __( 'Related Posts [CRP]', 'contextual-related-posts' ),
23
- description: __( 'Display related posts by Contextual Related Posts', 'contextual-related-posts' ),
24
- category: 'widgets',
25
- icon: 'list-view',
26
- keywords: [ __( 'related posts' ), __( 'contextual' ), __( 'posts' ) ],
27
-
28
- attributes: {
29
- heading: {
30
- type: 'boolean',
31
- default: false,
32
- },
33
- limit: {
34
- type: 'number',
35
- default: 6,
36
- },
37
- offset: {
38
- type: 'number',
39
- default: 0,
40
- },
41
- show_excerpt: {
42
- type: 'boolean',
43
- default: false,
44
- },
45
- show_author: {
46
- type: 'boolean',
47
- default: false,
48
- },
49
- show_date: {
50
- type: 'boolean',
51
- default: false,
52
- },
53
- post_thumb_op: {
54
- type: 'string',
55
- default: 'inline',
56
- },
57
- ordering: {
58
- type: 'string',
59
- default: 'relevance',
60
- },
61
- random_order: {
62
- type: 'boolean',
63
- default: false,
64
- },
65
- other_attributes: {
66
- type: 'string',
67
- default: '',
68
- },
69
- },
70
-
71
- supports: {
72
- html: false,
73
- },
74
-
75
- example: { },
76
-
77
- edit: function( props ) {
78
- const attributes = props.attributes;
79
- const setAttributes = props.setAttributes;
80
-
81
- var orderings = Object.keys(crp_php_variables.orderings).map(function(key) {
82
- return {value: key, label: crp_php_variables.orderings[key]};
83
- });
84
-
85
- if(props.isSelected){
86
- // console.debug(props.attributes);
87
- };
88
-
89
-
90
- // Functions to update attributes.
91
- function changeHeading(heading){
92
- setAttributes({heading});
93
- }
94
-
95
- function changeExcerpt(show_excerpt){
96
- setAttributes({show_excerpt});
97
- }
98
-
99
- function changeAuthor(show_author){
100
- setAttributes({show_author});
101
- }
102
-
103
- function changeDate(show_date){
104
- setAttributes({show_date});
105
- }
106
-
107
- function changeThumbnail(post_thumb_op){
108
- setAttributes({post_thumb_op});
109
- }
110
-
111
- function changeOrdering(ordering){
112
- setAttributes({ordering});
113
- }
114
-
115
- function changeRandomOrder(random_order){
116
- setAttributes({random_order});
117
- }
118
-
119
- function changeOtherAttributes(other_attributes){
120
- setAttributes({other_attributes});
121
- }
122
-
123
- return [
124
- /**
125
- * Server side render
126
- */
127
- el("div", { className: props.className },
128
- el( ServerSideRender, {
129
- block: 'contextual-related-posts/related-posts',
130
- attributes: attributes
131
- } )
132
- ),
133
-
134
- /**
135
- * Inspector
136
- */
137
- el( InspectorControls, {},
138
- el( PanelBody, { title: 'Related Posts Settings', initialOpen: true },
139
-
140
- el( ToggleControl, {
141
- label: __( 'Show heading', 'contextual-related-posts' ),
142
- checked: attributes.heading,
143
- onChange: changeHeading
144
- } ),
145
- el( TextControl, {
146
- label: __( 'No. of posts', 'contextual-related-posts' ),
147
- value: attributes.limit,
148
- onChange: function( val ) {
149
- setAttributes( { limit: parseInt( val ) } );
150
- },
151
- type: 'number',
152
- min: 1,
153
- step: 1
154
- } ),
155
-
156
- el( TextControl, {
157
- label: __( 'Offset', 'contextual-related-posts' ),
158
- value: attributes.offset,
159
- onChange: function( val ) {
160
- setAttributes( { offset: parseInt( val ) } );
161
- },
162
- type: 'number',
163
- min: 0,
164
- step: 1
165
- }),
166
-
167
- el( ToggleControl, {
168
- label: __( 'Show excerpt', 'contextual-related-posts' ),
169
- checked: attributes.show_excerpt,
170
- onChange: changeExcerpt
171
- } ),
172
- el( ToggleControl, {
173
- label: __( 'Show author', 'contextual-related-posts' ),
174
- checked: attributes.show_author,
175
- onChange: changeAuthor
176
- } ),
177
- el( ToggleControl, {
178
- label: __( 'Show date', 'contextual-related-posts' ),
179
- checked: attributes.show_date,
180
- onChange: changeDate
181
- } ),
182
- el(SelectControl, {
183
- value: attributes.post_thumb_op,
184
- label: __( 'Thumbnail options', 'contextual-related-posts' ),
185
- onChange: changeThumbnail,
186
- options: [
187
- {value: 'inline', label: __( 'Before title', 'contextual-related-posts' )},
188
- {value: 'after', label: __( 'After title', 'contextual-related-posts' )},
189
- {value: 'thumbs_only', label: __( 'Only thumbnail', 'contextual-related-posts' )},
190
- {value: 'text_only', label: __( 'Only text', 'contextual-related-posts' )},
191
- ]
192
- } ),
193
- el(RadioControl, {
194
- selected: attributes.ordering,
195
- label: __( 'Ordering', 'contextual-related-posts' ),
196
- onChange: changeOrdering,
197
- options: orderings
198
- } ),
199
- el( ToggleControl, {
200
- label: __( 'Randomize posts', 'contextual-related-posts' ),
201
- checked: attributes.random_order,
202
- onChange: changeRandomOrder
203
- } ),
204
- el( TextareaControl, {
205
- label: __( 'Other attributes', 'contextual-related-posts' ),
206
- help: __( 'Enter other attributes in a URL-style string-query. e.g. post_types=post,page&link_nofollow=1&exclude_post_ids=5,6', 'contextual-related-posts' ),
207
- value: attributes.other_attributes,
208
- onChange: changeOtherAttributes
209
- } )
210
- ),
211
- ),
212
- ]
213
- },
214
-
215
- save(){
216
- return null;//save has to exist. This all we need
217
- }
218
- } );
219
- } )(
220
- window.wp.blocks,
221
- window.wp.i18n,
222
- window.wp.element,
223
- window.wp.components,
224
- window.wp.editor,
225
- window.wp.blockEditor,
226
- window.wp.serverSideRender
227
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/blocks/related-posts/index.min.js DELETED
@@ -1 +0,0 @@
1
- !function(blocks,i18n,element,components,editor,blockEditor){var el=element.createElement;const{registerBlockType:registerBlockType}=blocks,{__:__}=i18n;var ServerSideRender=wp.serverSideRender;const{RichText:RichText,InspectorControls:InspectorControls}=blockEditor,{TextControl:TextControl,CheckboxControl:CheckboxControl,RadioControl:RadioControl,SelectControl:SelectControl,TextareaControl:TextareaControl,ToggleControl:ToggleControl,RangeControl:RangeControl,Panel:Panel,PanelBody:PanelBody,PanelRow:PanelRow}=components;registerBlockType("contextual-related-posts/related-posts",{title:__("Related Posts [CRP]","contextual-related-posts"),description:__("Display related posts by Contextual Related Posts","contextual-related-posts"),category:"widgets",icon:"list-view",keywords:[__("related posts"),__("contextual"),__("posts")],attributes:{heading:{type:"boolean",default:!1},limit:{type:"number",default:6},offset:{type:"number",default:0},show_excerpt:{type:"boolean",default:!1},show_author:{type:"boolean",default:!1},show_date:{type:"boolean",default:!1},post_thumb_op:{type:"string",default:"inline"},ordering:{type:"string",default:"relevance"},random_order:{type:"boolean",default:!1},other_attributes:{type:"string",default:""}},supports:{html:!1},example:{},edit:function(props){const attributes=props.attributes,setAttributes=props.setAttributes;var orderings=Object.keys(crp_php_variables.orderings).map((function(key){return{value:key,label:crp_php_variables.orderings[key]}}));function changeHeading(heading){setAttributes({heading:heading})}function changeExcerpt(show_excerpt){setAttributes({show_excerpt:show_excerpt})}function changeAuthor(show_author){setAttributes({show_author:show_author})}function changeDate(show_date){setAttributes({show_date:show_date})}function changeThumbnail(post_thumb_op){setAttributes({post_thumb_op:post_thumb_op})}function changeOrdering(ordering){setAttributes({ordering:ordering})}function changeRandomOrder(random_order){setAttributes({random_order:random_order})}function changeOtherAttributes(other_attributes){setAttributes({other_attributes:other_attributes})}return props.isSelected,[el("div",{className:props.className},el(ServerSideRender,{block:"contextual-related-posts/related-posts",attributes:attributes})),el(InspectorControls,{},el(PanelBody,{title:"Related Posts Settings",initialOpen:!0},el(ToggleControl,{label:__("Show heading","contextual-related-posts"),checked:attributes.heading,onChange:changeHeading}),el(TextControl,{label:__("No. of posts","contextual-related-posts"),value:attributes.limit,onChange:function(val){setAttributes({limit:parseInt(val)})},type:"number",min:1,step:1}),el(TextControl,{label:__("Offset","contextual-related-posts"),value:attributes.offset,onChange:function(val){setAttributes({offset:parseInt(val)})},type:"number",min:0,step:1}),el(ToggleControl,{label:__("Show excerpt","contextual-related-posts"),checked:attributes.show_excerpt,onChange:changeExcerpt}),el(ToggleControl,{label:__("Show author","contextual-related-posts"),checked:attributes.show_author,onChange:changeAuthor}),el(ToggleControl,{label:__("Show date","contextual-related-posts"),checked:attributes.show_date,onChange:changeDate}),el(SelectControl,{value:attributes.post_thumb_op,label:__("Thumbnail options","contextual-related-posts"),onChange:changeThumbnail,options:[{value:"inline",label:__("Before title","contextual-related-posts")},{value:"after",label:__("After title","contextual-related-posts")},{value:"thumbs_only",label:__("Only thumbnail","contextual-related-posts")},{value:"text_only",label:__("Only text","contextual-related-posts")}]}),el(RadioControl,{selected:attributes.ordering,label:__("Ordering","contextual-related-posts"),onChange:changeOrdering,options:orderings}),el(ToggleControl,{label:__("Randomize posts","contextual-related-posts"),checked:attributes.random_order,onChange:changeRandomOrder}),el(TextareaControl,{label:__("Other attributes","contextual-related-posts"),help:__("Enter other attributes in a URL-style string-query. e.g. post_types=post,page&link_nofollow=1&exclude_post_ids=5,6","contextual-related-posts"),value:attributes.other_attributes,onChange:changeOtherAttributes})))]},save:()=>null})}(window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.editor,window.wp.blockEditor,window.wp.serverSideRender);
 
includes/admin/blocks/related-posts/index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
includes/admin/default-settings.php CHANGED
@@ -106,28 +106,6 @@ function crp_settings_general() {
106
  'options' => '-1',
107
  'min' => '-1',
108
  ),
109
- 'same_taxes' => array(
110
- 'id' => 'same_taxes',
111
- 'name' => esc_html__( 'Only from same', 'crp-taxonomy' ),
112
- 'desc' => esc_html__( 'Limit the related posts only to the categories, tags, and/or taxonomies of the current post.', 'crp-taxonomy' ),
113
- 'type' => 'taxonomies',
114
- 'options' => '',
115
- ),
116
- 'match_all' => array(
117
- 'id' => 'match_all',
118
- 'name' => esc_html__( 'Match all taxonomies', 'crp-taxonomy' ),
119
- 'desc' => esc_html__( 'If enabled, then it will only select posts that match all the above selected taxonomies. This can result in no related posts being found.', 'crp-taxonomy' ),
120
- 'type' => 'checkbox',
121
- 'options' => false,
122
- ),
123
- 'no_of_common_terms' => array(
124
- 'id' => 'no_of_common_terms',
125
- 'name' => esc_html__( 'Number of common terms', 'crp-taxonomy' ),
126
- 'desc' => esc_html__( 'Enter the minimum number of common terms that have to be matched before a post is considered related.', 'crp-taxonomy' ),
127
- 'type' => 'number',
128
- 'options' => '1',
129
- 'min' => '1',
130
- ),
131
  'disable_on_mobile' => array(
132
  'id' => 'disable_on_mobile',
133
  'name' => esc_html__( 'Disable on mobile devices', 'contextual-related-posts' ),
@@ -264,6 +242,13 @@ function crp_settings_output() {
264
  'type' => 'checkbox',
265
  'options' => false,
266
  ),
 
 
 
 
 
 
 
267
  'title_length' => array(
268
  'id' => 'title_length',
269
  'name' => esc_html__( 'Limit post title length (in characters)', 'contextual-related-posts' ),
@@ -308,16 +293,13 @@ function crp_settings_output() {
308
  'options' => '',
309
  ),
310
  'exclude_on_cat_slugs' => array(
311
- 'id' => 'exclude_on_cat_slugs',
312
- 'name' => esc_html__( 'Exclude on Categories', 'crp-taxonomy' ),
313
- 'desc' => esc_html__( 'Comma separated list of category slugs. The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. Does not support custom taxonomies.', 'crp-taxonomy' ),
314
- 'type' => 'csv',
315
- 'options' => '',
316
- 'size' => 'large',
317
- 'field_class' => 'category_autocomplete',
318
- 'field_attributes' => array(
319
- 'data-wp-taxonomy' => 'category',
320
- ),
321
  ),
322
  'html_wrapper_header' => array(
323
  'id' => 'html_wrapper_header',
@@ -446,6 +428,35 @@ function crp_settings_list() {
446
  'type' => 'checkbox',
447
  'options' => false,
448
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  'exclude_post_ids' => array(
450
  'id' => 'exclude_post_ids',
451
  'name' => esc_html__( 'Post/page IDs to exclude', 'contextual-related-posts' ),
@@ -454,20 +465,17 @@ function crp_settings_list() {
454
  'options' => '',
455
  ),
456
  'exclude_cat_slugs' => array(
457
- 'id' => 'exclude_cat_slugs',
458
- 'name' => esc_html__( 'Exclude Categories', 'contextual-related-posts' ),
459
- 'desc' => esc_html__( 'Comma separated list of category slugs. The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. Does not support custom taxonomies.', 'contextual-related-posts' ),
460
- 'type' => 'csv',
461
- 'options' => '',
462
- 'size' => 'large',
463
- 'field_class' => 'category_autocomplete',
464
- 'field_attributes' => array(
465
- 'data-wp-taxonomy' => 'category',
466
- ),
467
  ),
468
  'exclude_categories' => array(
469
  'id' => 'exclude_categories',
470
- 'name' => esc_html__( 'Exclude category IDs', 'contextual-related-posts' ),
471
  'desc' => esc_html__( 'This is a readonly field that is automatically populated based on the above input when the settings are saved. These might differ from the IDs visible in the Categories page which use the term_id. Contextual Related Posts uses the term_taxonomy_id which is unique to this taxonomy.', 'contextual-related-posts' ),
472
  'type' => 'text',
473
  'options' => '',
@@ -475,15 +483,15 @@ function crp_settings_list() {
475
  ),
476
  'disable_contextual' => array(
477
  'id' => 'disable_contextual',
478
- 'name' => esc_html__( 'Disable contextual matching', 'crp-taxonomy' ),
479
- 'desc' => esc_html__( 'Selecting this option will turn off contextual matching. This is only useful if you activate the option: "Only from same" from the General tab. Otherwise, you will end up with the same set of related posts on all pages with no relevance.', 'crp-taxonomy' ),
480
  'type' => 'checkbox',
481
  'options' => false,
482
  ),
483
  'disable_contextual_cpt' => array(
484
  'id' => 'disable_contextual_cpt',
485
- 'name' => esc_html__( 'Disable contextual matching ONLY on attachments and custom post types', 'crp-taxonomy' ),
486
- 'desc' => esc_html__( 'Applies only if the previous option is checked. Selecting this option will retain contextual matching for posts and pages but disable this on any custom post types.', 'crp-taxonomy' ),
487
  'type' => 'checkbox',
488
  'options' => true,
489
  ),
106
  'options' => '-1',
107
  'min' => '-1',
108
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  'disable_on_mobile' => array(
110
  'id' => 'disable_on_mobile',
111
  'name' => esc_html__( 'Disable on mobile devices', 'contextual-related-posts' ),
242
  'type' => 'checkbox',
243
  'options' => false,
244
  ),
245
+ 'show_primary_term' => array(
246
+ 'id' => 'show_primary_term',
247
+ 'name' => esc_html__( 'Show primary category/term', 'contextual-related-posts' ),
248
+ 'desc' => esc_html__( 'This will display the primary category/term. This is usually set via your SEO plugin and will default to the first category/term returned by WordPress', 'contextual-related-posts' ),
249
+ 'type' => 'checkbox',
250
+ 'options' => false,
251
+ ),
252
  'title_length' => array(
253
  'id' => 'title_length',
254
  'name' => esc_html__( 'Limit post title length (in characters)', 'contextual-related-posts' ),
293
  'options' => '',
294
  ),
295
  'exclude_on_cat_slugs' => array(
296
+ 'id' => 'exclude_on_cat_slugs',
297
+ 'name' => esc_html__( 'Exclude on Terms', 'contextual-related-posts' ),
298
+ 'desc' => esc_html__( 'The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. This field requires a specific format as displayed by the autocomplete.', 'contextual-related-posts' ),
299
+ 'type' => 'csv',
300
+ 'options' => '',
301
+ 'size' => 'large',
302
+ 'field_class' => 'category_autocomplete',
 
 
 
303
  ),
304
  'html_wrapper_header' => array(
305
  'id' => 'html_wrapper_header',
428
  'type' => 'checkbox',
429
  'options' => false,
430
  ),
431
+ 'primary_term' => array(
432
+ 'id' => 'primary_term',
433
+ 'name' => esc_html__( 'Limit to same primary term', 'contextual-related-posts' ),
434
+ 'desc' => esc_html__( 'If enabled, then it will only select posts from the primary category/term. This is usually set via your SEO plugin and will default to the first category/term returned by WordPress', 'contextual-related-posts' ),
435
+ 'type' => 'checkbox',
436
+ 'options' => false,
437
+ ),
438
+ 'same_taxes' => array(
439
+ 'id' => 'same_taxes',
440
+ 'name' => esc_html__( 'Only from same', 'contextual-related-posts' ),
441
+ 'desc' => esc_html__( 'Limit the related posts only to the categories, tags, and/or taxonomies of the current post.', 'contextual-related-posts' ),
442
+ 'type' => 'taxonomies',
443
+ 'options' => '',
444
+ ),
445
+ 'match_all' => array(
446
+ 'id' => 'match_all',
447
+ 'name' => esc_html__( 'Match all taxonomies', 'contextual-related-posts' ),
448
+ 'desc' => esc_html__( 'If enabled, then it will only select posts that match all the above selected taxonomies. This can result in no related posts being found.', 'contextual-related-posts' ),
449
+ 'type' => 'checkbox',
450
+ 'options' => false,
451
+ ),
452
+ 'no_of_common_terms' => array(
453
+ 'id' => 'no_of_common_terms',
454
+ 'name' => esc_html__( 'Number of common terms', 'contextual-related-posts' ),
455
+ 'desc' => esc_html__( 'Enter the minimum number of common terms that have to be matched before a post is considered related.', 'contextual-related-posts' ),
456
+ 'type' => 'number',
457
+ 'options' => '1',
458
+ 'min' => '1',
459
+ ),
460
  'exclude_post_ids' => array(
461
  'id' => 'exclude_post_ids',
462
  'name' => esc_html__( 'Post/page IDs to exclude', 'contextual-related-posts' ),
465
  'options' => '',
466
  ),
467
  'exclude_cat_slugs' => array(
468
+ 'id' => 'exclude_cat_slugs',
469
+ 'name' => esc_html__( 'Exclude Terms', 'contextual-related-posts' ),
470
+ 'desc' => esc_html__( 'The field above has an autocomplete so simply start typing in the starting letters and it will prompt you with options. This field requires a specific format as displayed by the autocomplete.', 'contextual-related-posts' ),
471
+ 'type' => 'csv',
472
+ 'options' => '',
473
+ 'size' => 'large',
474
+ 'field_class' => 'category_autocomplete',
 
 
 
475
  ),
476
  'exclude_categories' => array(
477
  'id' => 'exclude_categories',
478
+ 'name' => esc_html__( 'Exclude Term Taxonomy IDs', 'contextual-related-posts' ),
479
  'desc' => esc_html__( 'This is a readonly field that is automatically populated based on the above input when the settings are saved. These might differ from the IDs visible in the Categories page which use the term_id. Contextual Related Posts uses the term_taxonomy_id which is unique to this taxonomy.', 'contextual-related-posts' ),
480
  'type' => 'text',
481
  'options' => '',
483
  ),
484
  'disable_contextual' => array(
485
  'id' => 'disable_contextual',
486
+ 'name' => esc_html__( 'Disable contextual matching', 'contextual-related-posts' ),
487
+ 'desc' => esc_html__( 'Selecting this option will turn off contextual matching. This is only useful if you activate the option: "Only from same" from the General tab. Otherwise, you will end up with the same set of related posts on all pages with no relevance.', 'contextual-related-posts' ),
488
  'type' => 'checkbox',
489
  'options' => false,
490
  ),
491
  'disable_contextual_cpt' => array(
492
  'id' => 'disable_contextual_cpt',
493
+ 'name' => esc_html__( 'Disable contextual matching ONLY on attachments and custom post types', 'contextual-related-posts' ),
494
+ 'desc' => esc_html__( 'Applies only if the previous option is checked. Selecting this option will retain contextual matching for posts and pages but disable this on any custom post types.', 'contextual-related-posts' ),
495
  'type' => 'checkbox',
496
  'options' => true,
497
  ),
includes/admin/js/crp-suggest.js CHANGED
@@ -7,9 +7,12 @@ jQuery(document).ready(function($) {
7
 
8
  options = options || {};
9
 
10
- var taxonomy = options.taxonomy || $element.attr( 'data-wp-taxonomy' ) || 'category';
11
  delete( options.taxonomy );
12
 
 
 
 
13
  function split( val ) {
14
  return val.split( /,(?=(?:(?:[^"]*"){2})*[^"]*$)/ ); // Split typical CSV format, with commas and double quotes.
15
  }
@@ -45,7 +48,7 @@ jQuery(document).ready(function($) {
45
  dataType: 'json',
46
  url: ajaxurl,
47
  data: {
48
- action: 'crp_tag_search',
49
  tax: taxonomy,
50
  q: term
51
  },
@@ -103,8 +106,4 @@ jQuery(document).ready(function($) {
103
  $( '.category_autocomplete' ).each( function ( i, element ) {
104
  $( element ).crpTagsSuggest();
105
  });
106
-
107
- $('.widget-liquid-right, #customize-controls').on( 'click', '.category_autocomplete', function() {
108
- $( '.category_autocomplete' ).crpTagsSuggest();
109
- });
110
  });
7
 
8
  options = options || {};
9
 
10
+ var taxonomy = options.taxonomy || $element.attr( 'data-wp-taxonomy' ) || '';
11
  delete( options.taxonomy );
12
 
13
+ var ajaxAction = options.ajaxAction || $element.attr( 'data-wp-ajax-action' ) || 'crp_tag_search';
14
+ delete( options.ajaxAction );
15
+
16
  function split( val ) {
17
  return val.split( /,(?=(?:(?:[^"]*"){2})*[^"]*$)/ ); // Split typical CSV format, with commas and double quotes.
18
  }
48
  dataType: 'json',
49
  url: ajaxurl,
50
  data: {
51
+ action: ajaxAction,
52
  tax: taxonomy,
53
  q: term
54
  },
106
  $( '.category_autocomplete' ).each( function ( i, element ) {
107
  $( element ).crpTagsSuggest();
108
  });
 
 
 
 
109
  });
includes/admin/js/crp-suggest.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready((function($){$.fn.crpTagsSuggest=function(options){var cache,last,$element=$(this),taxonomy=(options=options||{}).taxonomy||$element.attr("data-wp-taxonomy")||"category";function split(val){return val.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/)}function extractLast(term){return split(term).pop()}delete options.taxonomy,options=$.extend({minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},source:function(request,response){var term;last!==request.term?(term=extractLast(request.term),last!==request.term?($.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:"crp_tag_search",tax:taxonomy,q:term}}).done((function(data){cache=data,response(data)})),last=request.term):response(cache)):response(cache)},search:function(){var term;if(extractLast(this.value).length<2)return!1},focus:function(event,ui){event.preventDefault()},select:function(event,ui){var terms=split(this.value),val=ui.item.value;return-1!==val.indexOf(",")&&(val='"'+val+'"'),terms.pop(),terms.push(val),terms.push(""),this.value=terms.join(", "),!1}},options),$element.on("keydown",(function(event){event.keyCode===$.ui.keyCode.TAB&&$(this).autocomplete("instance").menu.active&&event.preventDefault()})).autocomplete(options)},$(".category_autocomplete").each((function(i,element){$(element).crpTagsSuggest()})),$(".widget-liquid-right, #customize-controls").on("click",".category_autocomplete",(function(){$(".category_autocomplete").crpTagsSuggest()}))}));
1
+ jQuery(document).ready((function($){$.fn.crpTagsSuggest=function(options){var cache,last,$element=$(this),taxonomy=(options=options||{}).taxonomy||$element.attr("data-wp-taxonomy")||"";delete options.taxonomy;var ajaxAction=options.ajaxAction||$element.attr("data-wp-ajax-action")||"crp_tag_search";function split(val){return val.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/)}function extractLast(term){return split(term).pop()}delete options.ajaxAction,options=$.extend({minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},source:function(request,response){var term;last!==request.term?(term=extractLast(request.term),last!==request.term?($.ajax({type:"POST",dataType:"json",url:ajaxurl,data:{action:ajaxAction,tax:taxonomy,q:term}}).done((function(data){cache=data,response(data)})),last=request.term):response(cache)):response(cache)},search:function(){var term;if(extractLast(this.value).length<2)return!1},focus:function(event,ui){event.preventDefault()},select:function(event,ui){var terms=split(this.value),val=ui.item.value;return-1!==val.indexOf(",")&&(val='"'+val+'"'),terms.pop(),terms.push(val),terms.push(""),this.value=terms.join(", "),!1}},options),$element.on("keydown",(function(event){event.keyCode===$.ui.keyCode.TAB&&$(this).autocomplete("instance").menu.active&&event.preventDefault()})).autocomplete(options)},$(".category_autocomplete").each((function(i,element){$(element).crpTagsSuggest()}))}));
includes/admin/modules/metabox.php CHANGED
@@ -88,6 +88,10 @@ function crp_call_meta_box() {
88
  $manual_related = isset( $post_meta['manual_related'] ) ? $post_meta['manual_related'] : '';
89
  $manual_related_array = explode( ',', $manual_related );
90
 
 
 
 
 
91
  // Keyword - word or phrase.
92
  $keyword = isset( $post_meta['keyword'] ) ? $post_meta['keyword'] : '';
93
 
@@ -138,7 +142,7 @@ function crp_call_meta_box() {
138
  echo '<li>';
139
 
140
  $title = get_the_title( $manual_related_post );
141
- echo '<a href="' . esc_url( get_permalink( $manual_related_post ) ) . '" target="_blank" title="' . esc_attr( $title ) . '" class="wherego_title">' . esc_attr( $title ) . '</a>. ';
142
  printf(
143
  /* translators: Post type name */
144
  esc_html__( 'This post type is: %s', 'contextual-related-posts' ),
@@ -151,6 +155,35 @@ function crp_call_meta_box() {
151
  </ol>
152
  <?php } ?>
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  <p>
155
  <label for="crp_thumb_meta"><strong><?php esc_html_e( 'Location of thumbnail', 'contextual-related-posts' ); ?>:</strong></label>
156
  <input type="text" id="crp_thumb_meta" name="crp_thumb_meta" value="<?php echo esc_attr( $value ); ?>" style="width:100%" />
@@ -253,6 +286,19 @@ function crp_save_meta_box( $post_id ) {
253
  $post_meta['manual_related'] = implode( ',', $manual_related_array );
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  /**
257
  * Filter the CRP Post meta variable which contains post-specific settings
258
  *
88
  $manual_related = isset( $post_meta['manual_related'] ) ? $post_meta['manual_related'] : '';
89
  $manual_related_array = explode( ',', $manual_related );
90
 
91
+ // Exclude post IDs.
92
+ $exclude_post_ids = isset( $post_meta['exclude_post_ids'] ) ? $post_meta['exclude_post_ids'] : '';
93
+ $exclude_post_ids_array = explode( ',', $exclude_post_ids );
94
+
95
  // Keyword - word or phrase.
96
  $keyword = isset( $post_meta['keyword'] ) ? $post_meta['keyword'] : '';
97
 
142
  echo '<li>';
143
 
144
  $title = get_the_title( $manual_related_post );
145
+ echo '<a href="' . esc_url( get_permalink( $manual_related_post ) ) . '" target="_blank" title="' . esc_attr( $title ) . '">' . esc_attr( $title ) . '</a>. ';
146
  printf(
147
  /* translators: Post type name */
148
  esc_html__( 'This post type is: %s', 'contextual-related-posts' ),
155
  </ol>
156
  <?php } ?>
157
 
158
+ <p>
159
+ <label for="exclude_post_ids"><strong><?php esc_html_e( 'Exclude post IDs:', 'contextual-related-posts' ); ?></strong></label>
160
+ <input type="text" id="exclude_post_ids" name="exclude_post_ids" value="<?php echo esc_attr( $exclude_post_ids ); ?>" style="width:100%" />
161
+ <em><?php esc_html_e( 'Comma separated list of post, page or custom post type IDs. e.g. 188,320,500.', 'contextual-related-posts' ); ?></em>
162
+ </p>
163
+
164
+ <?php if ( ! empty( $exclude_post_ids ) ) { ?>
165
+
166
+ <strong><?php esc_html_e( 'Excluded posts:', 'contextual-related-posts' ); ?></strong>
167
+ <ol>
168
+ <?php
169
+ foreach ( $exclude_post_ids_array as $exclude_post_ids_post ) {
170
+
171
+ echo '<li>';
172
+
173
+ $title = get_the_title( $exclude_post_ids_post );
174
+ echo '<a href="' . esc_url( get_permalink( $exclude_post_ids_post ) ) . '" target="_blank" title="' . esc_attr( $title ) . '">' . esc_attr( $title ) . '</a>. ';
175
+ printf(
176
+ /* translators: Post type name */
177
+ esc_html__( 'This post type is: %s', 'contextual-related-posts' ),
178
+ '<em>' . esc_html( get_post_type( $exclude_post_ids_post ) ) . '</em>'
179
+ );
180
+
181
+ echo '</li>';
182
+ }
183
+ ?>
184
+ </ol>
185
+ <?php } ?>
186
+
187
  <p>
188
  <label for="crp_thumb_meta"><strong><?php esc_html_e( 'Location of thumbnail', 'contextual-related-posts' ); ?>:</strong></label>
189
  <input type="text" id="crp_thumb_meta" name="crp_thumb_meta" value="<?php echo esc_attr( $value ); ?>" style="width:100%" />
286
  $post_meta['manual_related'] = implode( ',', $manual_related_array );
287
  }
288
 
289
+ // Save Manual related posts.
290
+ if ( isset( $_POST['exclude_post_ids'] ) ) {
291
+
292
+ $exclude_post_ids_array = array_map( 'absint', explode( ',', sanitize_text_field( wp_unslash( $_POST['exclude_post_ids'] ) ) ) );
293
+
294
+ foreach ( $exclude_post_ids_array as $key => $value ) {
295
+ if ( 'publish' !== get_post_status( $value ) ) {
296
+ unset( $exclude_post_ids_array[ $key ] );
297
+ }
298
+ }
299
+ $post_meta['exclude_post_ids'] = implode( ',', $exclude_post_ids_array );
300
+ }
301
+
302
  /**
303
  * Filter the CRP Post meta variable which contains post-specific settings
304
  *
includes/admin/save-settings.php CHANGED
@@ -318,16 +318,22 @@ function crp_change_settings_on_save( $settings ) {
318
 
319
  $exclude_cat_slugs = array_unique( str_getcsv( $settings['exclude_cat_slugs'] ) );
320
 
321
- foreach ( $exclude_cat_slugs as $cat_name ) {
322
- $cat = get_term_by( 'name', $cat_name, 'category' );
323
-
324
- // Fall back to slugs since that was the default format before v2.4.0.
325
- if ( false === $cat ) {
326
- $cat = get_term_by( 'slug', $cat_name, 'category' );
 
 
 
 
 
 
327
  }
328
- if ( isset( $cat->term_taxonomy_id ) ) {
329
- $exclude_categories[] = $cat->term_taxonomy_id;
330
- $exclude_categories_slugs[] = $cat->name;
331
  }
332
  }
333
  $settings['exclude_categories'] = isset( $exclude_categories ) ? join( ',', $exclude_categories ) : '';
@@ -339,12 +345,17 @@ function crp_change_settings_on_save( $settings ) {
339
 
340
  $exclude_on_cat_slugs = array_unique( str_getcsv( $settings['exclude_on_cat_slugs'] ) );
341
 
342
- foreach ( $exclude_on_cat_slugs as $cat_name ) {
343
- $cat = get_term_by( 'name', $cat_name, 'category' );
344
-
345
- if ( isset( $cat->term_taxonomy_id ) ) {
346
- $exclude_on_categories[] = $cat->term_taxonomy_id;
347
- $exclude_on_categories_slugs[] = $cat->name;
 
 
 
 
 
348
  }
349
  }
350
  $settings['exclude_on_categories'] = isset( $exclude_on_categories ) ? join( ',', $exclude_on_categories ) : '';
318
 
319
  $exclude_cat_slugs = array_unique( str_getcsv( $settings['exclude_cat_slugs'] ) );
320
 
321
+ foreach ( $exclude_cat_slugs as $slug ) {
322
+ // Pattern is Name (taxonomy:term_taxonomy_id).
323
+ preg_match( '/(.*)\((.*):(\d+)\)/i', $slug, $matches );
324
+ if ( isset( $matches[3] ) ) { // This holds the term_taxonomy_id.
325
+ $term = get_term_by( 'term_taxonomy_id', $matches[3] );
326
+ } else {
327
+ $term = get_term_by( 'name', $slug, 'category' );
328
+
329
+ // Fall back to slugs since that was the default format before v2.4.0.
330
+ if ( false === $term ) {
331
+ $term = get_term_by( 'slug', $slug, 'category' );
332
+ }
333
  }
334
+ if ( isset( $term->term_taxonomy_id ) ) {
335
+ $exclude_categories[] = $term->term_taxonomy_id;
336
+ $exclude_categories_slugs[] = "{$term->name} ({$term->taxonomy}:{$term->term_taxonomy_id})";
337
  }
338
  }
339
  $settings['exclude_categories'] = isset( $exclude_categories ) ? join( ',', $exclude_categories ) : '';
345
 
346
  $exclude_on_cat_slugs = array_unique( str_getcsv( $settings['exclude_on_cat_slugs'] ) );
347
 
348
+ foreach ( $exclude_on_cat_slugs as $slug ) {
349
+ // Pattern is Name (taxonomy:term_taxonomy_id).
350
+ preg_match( '/(.*)\((.*):(\d+)\)/i', $slug, $matches );
351
+ if ( isset( $matches[3] ) ) { // This holds the term_taxonomy_id.
352
+ $term = get_term_by( 'term_taxonomy_id', $matches[3] );
353
+ } else {
354
+ $term = get_term_by( 'name', $slug, 'category' );
355
+ }
356
+ if ( isset( $term->term_taxonomy_id ) ) {
357
+ $exclude_on_categories[] = $term->term_taxonomy_id;
358
+ $exclude_on_categories_slugs[] = "{$term->name} ({$term->taxonomy}:{$term->term_taxonomy_id})";
359
  }
360
  }
361
  $settings['exclude_on_categories'] = isset( $exclude_on_categories ) ? join( ',', $exclude_on_categories ) : '';
includes/admin/settings-page.php CHANGED
@@ -459,9 +459,20 @@ function crp_thumbsizes_callback( $args ) {
459
  } elseif ( isset( $args['default'] ) && $args['default'] === $name && ! isset( $crp_settings[ $args['id'] ] ) ) {
460
  $checked = true;
461
  }
 
462
 
463
- $html .= sprintf( '<input name="crp_settings[%1$s]" id="crp_settings[%1$s][%2$s]" type="radio" value="%2$s" %3$s /> ', sanitize_key( $args['id'] ), $name, checked( true, $checked, false ) );
464
- $html .= sprintf( '<label for="crp_settings[%1$s][%2$s]">%3$s</label> <br />', sanitize_key( $args['id'] ), $name, $name . ' (' . $option['width'] . 'x' . $option['height'] . ')' );
 
 
 
 
 
 
 
 
 
 
465
  }
466
 
467
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
@@ -679,16 +690,18 @@ function crp_tags_search() {
679
  wp_die( 0 );
680
  }
681
 
 
682
  $taxonomy = sanitize_key( $_REQUEST['tax'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
683
- $tax = get_taxonomy( $taxonomy );
684
- if ( ! $tax ) {
685
- wp_die( 0 );
686
- }
 
687
 
688
- if ( ! current_user_can( $tax->cap->assign_terms ) ) {
689
- wp_die( -1 );
 
690
  }
691
-
692
  $s = isset( $_REQUEST['q'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['q'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
693
 
694
  $comma = _x( ',', 'tag delimiter' );
@@ -712,18 +725,21 @@ function crp_tags_search() {
712
  wp_die();
713
  }
714
 
715
- $results = get_terms(
716
- $taxonomy,
717
  array(
 
718
  'name__like' => $s,
719
- 'fields' => 'names',
720
  'hide_empty' => false,
721
  )
722
  );
723
 
 
 
 
 
 
724
  echo wp_json_encode( $results );
725
  wp_die();
726
-
727
  }
728
  add_action( 'wp_ajax_nopriv_crp_tag_search', 'crp_tags_search' );
729
  add_action( 'wp_ajax_crp_tag_search', 'crp_tags_search' );
@@ -776,4 +792,3 @@ function crp_styles_messages( $html, $args ) {
776
  return $html;
777
  }
778
  add_filter( 'crp_after_setting_output', 'crp_styles_messages', 10, 2 );
779
-
459
  } elseif ( isset( $args['default'] ) && $args['default'] === $name && ! isset( $crp_settings[ $args['id'] ] ) ) {
460
  $checked = true;
461
  }
462
+ $cropped = $option['crop'] ? __( ' cropped', 'contextual-related-posts' ) : '';
463
 
464
+ $html .= sprintf(
465
+ '<input name="crp_settings[%1$s]" id="crp_settings[%1$s][%2$s]" type="radio" value="%2$s" %3$s /> ',
466
+ sanitize_key( $args['id'] ),
467
+ $name,
468
+ checked( true, $checked, false )
469
+ );
470
+ $html .= sprintf(
471
+ '<label for="crp_settings[%1$s][%2$s]">%3$s</label> <br />',
472
+ sanitize_key( $args['id'] ),
473
+ $name,
474
+ $name . ' (' . $option['width'] . 'x' . $option['height'] . $cropped . ')'
475
+ );
476
  }
477
 
478
  $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>';
690
  wp_die( 0 );
691
  }
692
 
693
+ $tax = '';
694
  $taxonomy = sanitize_key( $_REQUEST['tax'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
695
+ if ( ! empty( $taxonomy ) ) {
696
+ $tax = get_taxonomy( $taxonomy );
697
+ if ( ! $tax ) {
698
+ wp_die( 0 );
699
+ }
700
 
701
+ if ( ! current_user_can( $tax->cap->assign_terms ) ) {
702
+ wp_die( -1 );
703
+ }
704
  }
 
705
  $s = isset( $_REQUEST['q'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['q'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
706
 
707
  $comma = _x( ',', 'tag delimiter' );
725
  wp_die();
726
  }
727
 
728
+ $terms = get_terms(
 
729
  array(
730
+ 'taxonomy' => ! empty( $taxonomy ) ? $taxonomy : null,
731
  'name__like' => $s,
 
732
  'hide_empty' => false,
733
  )
734
  );
735
 
736
+ $results = array();
737
+ foreach ( (array) $terms as $term ) {
738
+ $results[] = "{$term->name} ({$term->taxonomy}:{$term->term_taxonomy_id})";
739
+ }
740
+
741
  echo wp_json_encode( $results );
742
  wp_die();
 
743
  }
744
  add_action( 'wp_ajax_nopriv_crp_tag_search', 'crp_tags_search' );
745
  add_action( 'wp_ajax_crp_tag_search', 'crp_tags_search' );
792
  return $html;
793
  }
794
  add_filter( 'crp_after_setting_output', 'crp_styles_messages', 10, 2 );
 
includes/{admin/blocks → blocks}/index.php RENAMED
File without changes
includes/blocks/register-blocks.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions to register client-side assets (scripts and stylesheets) for the
4
+ * Gutenberg block.
5
+ *
6
+ * @package Contextual_Related_Posts
7
+ */
8
+
9
+ /**
10
+ * Registers the block using the metadata loaded from the `block.json` file.
11
+ * Behind the scenes, it registers also all assets so they can be enqueued
12
+ * through the block editor in the corresponding context.
13
+ *
14
+ * @since 3.2.0
15
+ */
16
+ function crp_register_blocks() {
17
+ // Register Popular Posts block.
18
+ register_block_type_from_metadata(
19
+ CRP_PLUGIN_DIR . 'includes/blocks/related-posts/',
20
+ array(
21
+ 'render_callback' => 'render_crp_block',
22
+ )
23
+ );
24
+ }
25
+ add_action( 'init', 'crp_register_blocks' );
26
+
27
+
28
+ /**
29
+ * Renders the `contextual-related-posts/related-posts` block on server.
30
+ *
31
+ * @since 2.8.0
32
+ * @param array $attributes The block attributes.
33
+ *
34
+ * @return string Returns the post content with latest posts added.
35
+ */
36
+ function render_crp_block( $attributes ) {
37
+
38
+ $attributes['extra_class'] = $attributes['className'];
39
+
40
+ $arguments = array_merge(
41
+ $attributes,
42
+ array(
43
+ 'is_block' => 1,
44
+ )
45
+ );
46
+
47
+ $arguments = wp_parse_args( $attributes['other_attributes'], $arguments );
48
+
49
+ /**
50
+ * Filters arguments passed to get_crp for the block.
51
+ *
52
+ * @since 2.8.0
53
+ *
54
+ * @param array $arguments CRP block options array.
55
+ * @param array $attributes Block attributes array.
56
+ */
57
+ $arguments = apply_filters( 'crp_block_options', $arguments, $attributes );
58
+
59
+ return get_crp( $arguments );
60
+ }
61
+
62
+ /**
63
+ * Enqueue scripts and styles for the block editor.
64
+ *
65
+ * @since 3.2.0
66
+ */
67
+ function crp_enqueue_block_editor_assets() {
68
+
69
+ $style_array = crp_get_style();
70
+ $file_prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
71
+
72
+ if ( ! empty( $style_array['name'] ) ) {
73
+ $style = $style_array['name'];
74
+ $extra_css = $style_array['extra_css'];
75
+
76
+ wp_enqueue_style(
77
+ 'related-posts-block-editor',
78
+ plugins_url( "css/{$style}{$file_prefix}.css", CRP_PLUGIN_FILE ),
79
+ array( 'wp-edit-blocks' ),
80
+ filemtime( CRP_PLUGIN_DIR . "css/{$style}{$file_prefix}.css" )
81
+ );
82
+ wp_add_inline_style( 'related-posts-block-editor', $extra_css );
83
+ }
84
+ }
85
+ add_action( 'enqueue_block_editor_assets', 'crp_enqueue_block_editor_assets' );
includes/blocks/related-posts/block.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "name": "contextual-related-posts/related-posts",
5
+ "version": "2.0.0",
6
+ "title": "Contextual Related Posts",
7
+ "category": "widgets",
8
+ "icon": "list-view",
9
+ "keywords": ["related posts", "posts", "contextual"],
10
+ "description": "Display the Related Posts",
11
+ "supports": {
12
+ "html": false
13
+ },
14
+ "attributes": {
15
+ "className": {
16
+ "type": "string",
17
+ "default": ""
18
+ },
19
+ "heading": {
20
+ "type": "boolean",
21
+ "default": false
22
+ },
23
+ "limit": {
24
+ "type": "string",
25
+ "default": 6
26
+ },
27
+ "offset": {
28
+ "type": "string",
29
+ "default": 0
30
+ },
31
+ "show_excerpt": {
32
+ "type": "boolean",
33
+ "default": false
34
+ },
35
+ "show_author": {
36
+ "type": "boolean",
37
+ "default": false
38
+ },
39
+ "show_date": {
40
+ "type": "boolean",
41
+ "default": false
42
+ },
43
+ "post_thumb_op": {
44
+ "type": "string",
45
+ "default": "inline"
46
+ },
47
+ "ordering": {
48
+ "type": "string",
49
+ "default": "relevance"
50
+ },
51
+ "random_order": {
52
+ "type": "boolean",
53
+ "default": false
54
+ },
55
+ "other_attributes": {
56
+ "type": "string",
57
+ "default": ""
58
+ }
59
+ },
60
+ "textdomain": "contextual-related-posts",
61
+ "editorScript": "file:./build/index.js"
62
+ }
includes/blocks/related-posts/build/index.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '79313b027ff695c9e9ad15ab1d965fb2');
includes/blocks/related-posts/build/index.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(){"use strict";var e={n:function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,{a:l}),l},d:function(t,l){for(var o in l)e.o(l,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:l[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.blocks,l=window.wp.element,o=window.wp.i18n,a=window.wp.serverSideRender,n=e.n(a),r=window.wp.blockEditor,s=window.wp.components;(0,t.registerBlockType)("contextual-related-posts/related-posts",{edit:function(e){let{attributes:t,setAttributes:a}=e;function d(e){return void 0===e||0===e||""===e||isNaN(e)?"":parseInt(e)}const{heading:u,limit:c,offset:p,show_excerpt:i,show_author:_,show_date:h,random_order:m,ordering:x,post_thumb_op:b,other_attributes:f}=t,w=(0,r.useBlockProps)();return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(r.InspectorControls,null,(0,l.createElement)(s.PanelBody,{title:(0,o.__)("Related Posts Settings","contextual-related-posts"),initialOpen:!0},(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.ToggleControl,{label:(0,o.__)("Show heading","contextual-related-posts"),help:u?(0,o.__)("Heading displayed","contextual-related-posts"):(0,o.__)("No Heading displayed","contextual-related-posts"),checked:u,onChange:()=>{a({heading:!u})}}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.TextControl,{label:(0,o.__)("Number of posts","contextual-related-posts"),value:c,onChange:e=>{a({limit:d(e)})},help:(0,o.__)("Maximum number of posts to display","contextual-related-posts")}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.TextControl,{label:(0,o.__)("Offset","contextual-related-posts"),value:p,onChange:e=>{a({offset:d(e)})},help:(0,o.__)("Number of posts to skip from the top","contextual-related-posts")}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.ToggleControl,{label:(0,o.__)("Show excerpt","contextual-related-posts"),help:i?(0,o.__)("Excerpt displayed","contextual-related-posts"):(0,o.__)("No excerpt","contextual-related-posts"),checked:i,onChange:()=>{a({show_excerpt:!i})}}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.ToggleControl,{label:(0,o.__)("Show author","contextual-related-posts"),help:_?(0,o.__)('"by Author Name" displayed',"contextual-related-posts"):(0,o.__)("No author displayed","contextual-related-posts"),checked:_,onChange:()=>{a({show_author:!_})}}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.ToggleControl,{label:(0,o.__)("Show date","contextual-related-posts"),help:h?(0,o.__)("Date of post displayed","contextual-related-posts"):(0,o.__)("Date of post not displayed","contextual-related-posts"),checked:h,onChange:()=>{a({show_date:!h})}}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.SelectControl,{label:(0,o.__)("Thumbnail option","contextual-related-posts"),value:b,onChange:e=>{a({post_thumb_op:e})},help:(0,o.__)("Location of the post thumbnail","contextual-related-posts"),options:[{value:"inline",label:(0,o.__)("Before title","contextual-related-posts")},{value:"after",label:(0,o.__)("After title","contextual-related-posts")},{value:"thumbs_only",label:(0,o.__)("Only thumbnail","contextual-related-posts")},{value:"text_only",label:(0,o.__)("Only text","contextual-related-posts")}]}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.RadioControl,{label:(0,o.__)("Order posts","contextual-related-posts"),selected:x,onChange:e=>{a({ordering:e})},help:(0,o.__)("This option directly edits the query","contextual-related-posts"),options:[{value:"relevance",label:(0,o.__)("By relevance","contextual-related-posts")},{value:"random",label:(0,o.__)("Randomly","contextual-related-posts")},{value:"date",label:(0,o.__)("By date","contextual-related-posts")}]}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.ToggleControl,{label:(0,o.__)("Randomize posts","contextual-related-posts"),help:m?(0,o.__)("Posts are shuffled on each load","contextual-related-posts"):(0,o.__)("Posts displayed based on above setting","contextual-related-posts"),checked:m,onChange:()=>{a({random_order:!m})}}))),(0,l.createElement)(s.PanelRow,null,(0,l.createElement)("fieldset",null,(0,l.createElement)(s.TextareaControl,{label:(0,o.__)("Other attributes","contextual-related-posts"),value:f,onChange:e=>{a({other_attributes:void 0===e?"":e})},help:(0,o.__)("Enter other attributes in a URL-style string-query. e.g. post_types=post,page&link_nofollow=1&exclude_post_ids=5,6","contextual-related-posts")}))))),(0,l.createElement)("div",w,(0,l.createElement)(n(),{block:"contextual-related-posts/related-posts",attributes:t})))},save:()=>null})}();
includes/blocks/related-posts/src/edit.js ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Retrieves the translation of text.
3
+ *
4
+ * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
5
+ */
6
+ import { __ } from '@wordpress/i18n';
7
+
8
+ import ServerSideRender from '@wordpress/server-side-render';
9
+
10
+ /**
11
+ * React hook that is used to mark the block wrapper element.
12
+ * It provides all the necessary props like the class name.
13
+ *
14
+ * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps
15
+ */
16
+ import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
17
+
18
+ import {
19
+ TextControl,
20
+ TextareaControl,
21
+ ToggleControl,
22
+ PanelBody,
23
+ PanelRow,
24
+ SelectControl,
25
+ RadioControl,
26
+ } from '@wordpress/components';
27
+
28
+ /**
29
+ * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
30
+ * Those files can contain any CSS code that gets applied to the editor.
31
+ *
32
+ * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
33
+ */
34
+ //import './editor.scss';
35
+
36
+ /**
37
+ * The edit function describes the structure of your block in the context of the
38
+ * editor. This represents what the editor will render when the block is used.
39
+ *
40
+ * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit
41
+ *
42
+ * @return {WPElement} Element to render.
43
+ */
44
+ export default function Edit({ attributes, setAttributes }) {
45
+ function processNumber(input) {
46
+ const output =
47
+ undefined === input || 0 === input || '' === input || isNaN(input)
48
+ ? ''
49
+ : parseInt(input);
50
+ return output;
51
+ }
52
+
53
+ const {
54
+ heading,
55
+ limit,
56
+ offset,
57
+ show_excerpt,
58
+ show_author,
59
+ show_date,
60
+ random_order,
61
+ ordering,
62
+ post_thumb_op,
63
+ other_attributes,
64
+ } = attributes;
65
+
66
+ const blockProps = useBlockProps();
67
+ const toggleHeading = () => {
68
+ setAttributes({ heading: !heading });
69
+ };
70
+ const onChangeLimit = (newLimit) => {
71
+ setAttributes({ limit: processNumber(newLimit) });
72
+ };
73
+ const onChangeOffset = (newOffset) => {
74
+ setAttributes({ offset: processNumber(newOffset) });
75
+ };
76
+ const toggleShowExcerpt = () => {
77
+ setAttributes({ show_excerpt: !show_excerpt });
78
+ };
79
+ const toggleShowAuthor = () => {
80
+ setAttributes({ show_author: !show_author });
81
+ };
82
+ const toggleShowDate = () => {
83
+ setAttributes({ show_date: !show_date });
84
+ };
85
+ const toggleRandomOrder = () => {
86
+ setAttributes({ random_order: !random_order });
87
+ };
88
+ const onChangeOrdering = (newOrdering) => {
89
+ setAttributes({ ordering: newOrdering });
90
+ };
91
+ const onChangeThumbnail = (newThumbnailLoc) => {
92
+ setAttributes({ post_thumb_op: newThumbnailLoc });
93
+ };
94
+ const onChangeOtherAttributes = (newOtherAttributes) => {
95
+ setAttributes({
96
+ other_attributes:
97
+ undefined === newOtherAttributes ? '' : newOtherAttributes,
98
+ });
99
+ };
100
+
101
+ return (
102
+ <>
103
+ <InspectorControls>
104
+ <PanelBody
105
+ title={__('Related Posts Settings', 'contextual-related-posts')}
106
+ initialOpen={true}
107
+ >
108
+ <PanelRow>
109
+ <fieldset>
110
+ <ToggleControl
111
+ label={__('Show heading', 'contextual-related-posts')}
112
+ help={
113
+ heading
114
+ ? __('Heading displayed', 'contextual-related-posts')
115
+ : __('No Heading displayed', 'contextual-related-posts')
116
+ }
117
+ checked={heading}
118
+ onChange={toggleHeading}
119
+ />
120
+ </fieldset>
121
+ </PanelRow>
122
+ <PanelRow>
123
+ <fieldset>
124
+ <TextControl
125
+ label={__('Number of posts', 'contextual-related-posts')}
126
+ value={limit}
127
+ onChange={onChangeLimit}
128
+ help={__(
129
+ 'Maximum number of posts to display',
130
+ 'contextual-related-posts'
131
+ )}
132
+ />
133
+ </fieldset>
134
+ </PanelRow>
135
+ <PanelRow>
136
+ <fieldset>
137
+ <TextControl
138
+ label={__('Offset', 'contextual-related-posts')}
139
+ value={offset}
140
+ onChange={onChangeOffset}
141
+ help={__(
142
+ 'Number of posts to skip from the top',
143
+ 'contextual-related-posts'
144
+ )}
145
+ />
146
+ </fieldset>
147
+ </PanelRow>
148
+ <PanelRow>
149
+ <fieldset>
150
+ <ToggleControl
151
+ label={__('Show excerpt', 'contextual-related-posts')}
152
+ help={
153
+ show_excerpt
154
+ ? __('Excerpt displayed', 'contextual-related-posts')
155
+ : __('No excerpt', 'contextual-related-posts')
156
+ }
157
+ checked={show_excerpt}
158
+ onChange={toggleShowExcerpt}
159
+ />
160
+ </fieldset>
161
+ </PanelRow>
162
+ <PanelRow>
163
+ <fieldset>
164
+ <ToggleControl
165
+ label={__('Show author', 'contextual-related-posts')}
166
+ help={
167
+ show_author
168
+ ? __(
169
+ '"by Author Name" displayed',
170
+ 'contextual-related-posts'
171
+ )
172
+ : __('No author displayed', 'contextual-related-posts')
173
+ }
174
+ checked={show_author}
175
+ onChange={toggleShowAuthor}
176
+ />
177
+ </fieldset>
178
+ </PanelRow>
179
+ <PanelRow>
180
+ <fieldset>
181
+ <ToggleControl
182
+ label={__('Show date', 'contextual-related-posts')}
183
+ help={
184
+ show_date
185
+ ? __('Date of post displayed', 'contextual-related-posts')
186
+ : __(
187
+ 'Date of post not displayed',
188
+ 'contextual-related-posts'
189
+ )
190
+ }
191
+ checked={show_date}
192
+ onChange={toggleShowDate}
193
+ />
194
+ </fieldset>
195
+ </PanelRow>
196
+ <PanelRow>
197
+ <fieldset>
198
+ <SelectControl
199
+ label={__('Thumbnail option', 'contextual-related-posts')}
200
+ value={post_thumb_op}
201
+ onChange={onChangeThumbnail}
202
+ help={__(
203
+ 'Location of the post thumbnail',
204
+ 'contextual-related-posts'
205
+ )}
206
+ options={[
207
+ {
208
+ value: 'inline',
209
+ label: __('Before title', 'contextual-related-posts'),
210
+ },
211
+ {
212
+ value: 'after',
213
+ label: __('After title', 'contextual-related-posts'),
214
+ },
215
+ {
216
+ value: 'thumbs_only',
217
+ label: __('Only thumbnail', 'contextual-related-posts'),
218
+ },
219
+ {
220
+ value: 'text_only',
221
+ label: __('Only text', 'contextual-related-posts'),
222
+ },
223
+ ]}
224
+ />
225
+ </fieldset>
226
+ </PanelRow>
227
+ <PanelRow>
228
+ <fieldset>
229
+ <RadioControl
230
+ label={__('Order posts', 'contextual-related-posts')}
231
+ selected={ordering}
232
+ onChange={onChangeOrdering}
233
+ help={__(
234
+ 'This option directly edits the query',
235
+ 'contextual-related-posts'
236
+ )}
237
+ options={[
238
+ {
239
+ value: 'relevance',
240
+ label: __('By relevance', 'contextual-related-posts'),
241
+ },
242
+ {
243
+ value: 'random',
244
+ label: __('Randomly', 'contextual-related-posts'),
245
+ },
246
+ {
247
+ value: 'date',
248
+ label: __('By date', 'contextual-related-posts'),
249
+ },
250
+ ]}
251
+ />
252
+ </fieldset>
253
+ </PanelRow>
254
+ <PanelRow>
255
+ <fieldset>
256
+ <ToggleControl
257
+ label={__('Randomize posts', 'contextual-related-posts')}
258
+ help={
259
+ random_order
260
+ ? __(
261
+ 'Posts are shuffled on each load',
262
+ 'contextual-related-posts'
263
+ )
264
+ : __(
265
+ 'Posts displayed based on above setting',
266
+ 'contextual-related-posts'
267
+ )
268
+ }
269
+ checked={random_order}
270
+ onChange={toggleRandomOrder}
271
+ />
272
+ </fieldset>
273
+ </PanelRow>
274
+ <PanelRow>
275
+ <fieldset>
276
+ <TextareaControl
277
+ label={__('Other attributes', 'contextual-related-posts')}
278
+ value={other_attributes}
279
+ onChange={onChangeOtherAttributes}
280
+ help={__(
281
+ 'Enter other attributes in a URL-style string-query. e.g. post_types=post,page&link_nofollow=1&exclude_post_ids=5,6',
282
+ 'contextual-related-posts'
283
+ )}
284
+ />
285
+ </fieldset>
286
+ </PanelRow>
287
+ </PanelBody>
288
+ </InspectorControls>
289
+
290
+ <div {...blockProps}>
291
+ <ServerSideRender
292
+ block="contextual-related-posts/related-posts"
293
+ attributes={attributes}
294
+ />
295
+ </div>
296
+ </>
297
+ );
298
+ }
includes/blocks/related-posts/src/index.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Registers a new block provided a unique name and an object defining its behavior.
3
+ *
4
+ * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
5
+ */
6
+ import { registerBlockType } from '@wordpress/blocks';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import Edit from './edit';
12
+
13
+ /**
14
+ * Every block starts by registering a new block type definition.
15
+ *
16
+ * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
17
+ */
18
+ registerBlockType('contextual-related-posts/related-posts', {
19
+ /**
20
+ * @see ./edit.js
21
+ */
22
+ edit: Edit,
23
+
24
+ save() {
25
+ return null;
26
+ },
27
+ });
includes/class-crp-query.php CHANGED
@@ -245,12 +245,34 @@ if ( ! class_exists( 'CRP_Query' ) ) :
245
  );
246
  }
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  // Process same taxonomies option.
249
  if ( isset( $args['same_taxes'] ) && $args['same_taxes'] ) {
250
  $taxonomies = explode( ',', $args['same_taxes'] );
251
 
252
  // Get the taxonomies used by the post type.
253
- $post_taxonomies = get_object_taxonomies( $source_post );
 
 
254
 
255
  // Only limit the taxonomies to what is selected for the current post.
256
  $current_taxonomies = array_values( array_intersect( $taxonomies, $post_taxonomies ) );
@@ -310,11 +332,13 @@ if ( ! class_exists( 'CRP_Query' ) ) :
310
  *
311
  * @since 2.3.0
312
  * @since 2.9.3 Added $args
 
313
  *
314
- * @param array $exclude_post_ids Array of post IDs.
315
- * @param array $args Arguments array.
 
316
  */
317
- $exclude_post_ids = apply_filters( 'crp_exclude_post_ids', $exclude_post_ids, $args );
318
 
319
  $exclude_post_ids[] = $source_post->ID;
320
  $args['post__not_in'] = $exclude_post_ids;
@@ -374,7 +398,6 @@ if ( ! class_exists( 'CRP_Query' ) ) :
374
  // Are we matching only the title or the post content as well?
375
  $match_fields = array(
376
  "$wpdb->posts.post_title",
377
- "$wpdb->posts.post_content",
378
  );
379
 
380
  $match_fields_content = array(
@@ -382,6 +405,7 @@ if ( ! class_exists( 'CRP_Query' ) ) :
382
  );
383
 
384
  if ( $this->query_args['match_content'] ) {
 
385
  $match_fields_content[] = $this->strip_stopwords( crp_excerpt( $this->source_post, min( $this->query_args['match_content_words'], CRP_MAX_WORDS ), false ) );
386
  }
387
 
@@ -457,8 +481,8 @@ if ( ! class_exists( 'CRP_Query' ) ) :
457
  *
458
  * @since 3.0.0
459
  *
460
- * @param string $fields The SELECT clause of the query.
461
- * @param WP_Query $query The WP_Query instance.
462
  * @return string Updated Fields
463
  */
464
  public function posts_fields( $fields, $query ) {
@@ -473,6 +497,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
473
  $fields .= $match;
474
  }
475
 
 
 
 
 
 
 
 
 
 
 
476
  return $fields;
477
  }
478
 
@@ -498,6 +532,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
498
  $join .= " INNER JOIN $wpdb->term_taxonomy AS crp_tt ON (crp_tr.term_taxonomy_id = crp_tt.term_taxonomy_id) ";
499
  }
500
 
 
 
 
 
 
 
 
 
 
 
501
  return $join;
502
  }
503
 
@@ -563,6 +607,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
563
  }
564
  }
565
 
 
 
 
 
 
 
 
 
 
 
566
  return $where;
567
  }
568
 
@@ -597,6 +651,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
597
  $orderby = " $wpdb->posts.post_date DESC ";
598
  }
599
 
 
 
 
 
 
 
 
 
 
 
600
  return $orderby;
601
  }
602
 
@@ -638,6 +702,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
638
 
639
  }
640
 
 
 
 
 
 
 
 
 
 
 
641
  return $sql;
642
  }
643
 
@@ -646,9 +720,9 @@ if ( ! class_exists( 'CRP_Query' ) ) :
646
  *
647
  * @since 3.0.0
648
  *
649
- * @param string $posts Array of post data.
650
- * @param WP_Query $query The WP_Query instance.
651
- * @return string Updated Array of post objects.
652
  */
653
  public function posts_pre_query( $posts, $query ) {
654
 
@@ -680,6 +754,16 @@ if ( ! class_exists( 'CRP_Query' ) ) :
680
  }
681
  }
682
 
 
 
 
 
 
 
 
 
 
 
683
  return $posts;
684
  }
685
 
@@ -736,16 +820,43 @@ if ( ! class_exists( 'CRP_Query' ) ) :
736
  $posts = array_merge( $extra_posts, $posts );
737
  }
738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  /**
740
  * Filter array of WP_Post objects before it is returned to the CRP_Query instance.
741
  *
742
  * @since 1.9
743
  * @since 2.9.3 Added $args
744
  *
745
- * @param object $posts Array of post objects.
746
- * @param array $args Arguments array.
 
747
  */
748
- return apply_filters( 'crp_query_the_posts', $posts, $this->query_args );
749
  }
750
  }
751
  endif;
245
  );
246
  }
247
 
248
+ if ( ! empty( $args['primary_term'] ) ) {
249
+ // Get the taxonomies used by the post type.
250
+ $post_taxonomies = get_object_taxonomies( $source_post );
251
+
252
+ foreach ( (array) $post_taxonomies as $term ) {
253
+ if ( empty( $primary_term['primary'] ) ) {
254
+ $primary_term = crp_get_primary_term( $source_post, $term );
255
+ }
256
+ }
257
+
258
+ if ( ! empty( $primary_term['primary'] ) ) {
259
+
260
+ $tax_query[] = array(
261
+ 'field' => 'term_taxonomy_id',
262
+ 'terms' => wp_parse_id_list( $primary_term['primary']->term_taxonomy_id ),
263
+ 'include_children' => false,
264
+ );
265
+ }
266
+ }
267
+
268
  // Process same taxonomies option.
269
  if ( isset( $args['same_taxes'] ) && $args['same_taxes'] ) {
270
  $taxonomies = explode( ',', $args['same_taxes'] );
271
 
272
  // Get the taxonomies used by the post type.
273
+ if ( empty( $post_taxonomies ) ) {
274
+ $post_taxonomies = get_object_taxonomies( $source_post );
275
+ }
276
 
277
  // Only limit the taxonomies to what is selected for the current post.
278
  $current_taxonomies = array_values( array_intersect( $taxonomies, $post_taxonomies ) );
332
  *
333
  * @since 2.3.0
334
  * @since 2.9.3 Added $args
335
+ * @since 3.2.0 Added $source_post
336
  *
337
+ * @param array $exclude_post_ids Array of post IDs.
338
+ * @param array $args Arguments array.
339
+ * @param WP_Post $source_post Source post.
340
  */
341
+ $exclude_post_ids = apply_filters( 'crp_exclude_post_ids', $exclude_post_ids, $args, $source_post );
342
 
343
  $exclude_post_ids[] = $source_post->ID;
344
  $args['post__not_in'] = $exclude_post_ids;
398
  // Are we matching only the title or the post content as well?
399
  $match_fields = array(
400
  "$wpdb->posts.post_title",
 
401
  );
402
 
403
  $match_fields_content = array(
405
  );
406
 
407
  if ( $this->query_args['match_content'] ) {
408
+ $match_fields[] = "$wpdb->posts.post_content";
409
  $match_fields_content[] = $this->strip_stopwords( crp_excerpt( $this->source_post, min( $this->query_args['match_content_words'], CRP_MAX_WORDS ), false ) );
410
  }
411
 
481
  *
482
  * @since 3.0.0
483
  *
484
+ * @param string $fields The SELECT clause of the query.
485
+ * @param WP_Query $query The WP_Query instance.
486
  * @return string Updated Fields
487
  */
488
  public function posts_fields( $fields, $query ) {
497
  $fields .= $match;
498
  }
499
 
500
+ /**
501
+ * Filters the posts_fields of CRP_Query after processing and before returning.
502
+ *
503
+ * @since 3.2.0
504
+ *
505
+ * @param string $fields The SELECT clause of the query.
506
+ * @param WP_Query $query The WP_Query instance.
507
+ */
508
+ $fields = apply_filters( 'crp_query_posts_fields', $fields, $query );
509
+
510
  return $fields;
511
  }
512
 
532
  $join .= " INNER JOIN $wpdb->term_taxonomy AS crp_tt ON (crp_tr.term_taxonomy_id = crp_tt.term_taxonomy_id) ";
533
  }
534
 
535
+ /**
536
+ * Filters the posts_join of CRP_Query after processing and before returning.
537
+ *
538
+ * @since 3.2.0
539
+ *
540
+ * @param string $join The JOIN clause of the query.
541
+ * @param WP_Query $query The WP_Query instance.
542
+ */
543
+ $join = apply_filters( 'crp_query_posts_join', $join, $query );
544
+
545
  return $join;
546
  }
547
 
607
  }
608
  }
609
 
610
+ /**
611
+ * Filters the posts_where of CRP_Query after processing and before returning.
612
+ *
613
+ * @since 3.2.0
614
+ *
615
+ * @param string $where The WHERE clause of the query.
616
+ * @param WP_Query $query The WP_Query instance.
617
+ */
618
+ $where = apply_filters( 'crp_query_posts_where', $where, $query );
619
+
620
  return $where;
621
  }
622
 
651
  $orderby = " $wpdb->posts.post_date DESC ";
652
  }
653
 
654
+ /**
655
+ * Filters the posts_orderby of CRP_Query after processing and before returning.
656
+ *
657
+ * @since 3.2.0
658
+ *
659
+ * @param string $orderby The SELECT clause of the query.
660
+ * @param WP_Query $query The WP_Query instance.
661
+ */
662
+ $orderby = apply_filters( 'crp_query_posts_orderby', $orderby, $query );
663
+
664
  return $orderby;
665
  }
666
 
702
 
703
  }
704
 
705
+ /**
706
+ * Filters the posts_request of CRP_Query after processing and before returning.
707
+ *
708
+ * @since 3.2.0
709
+ *
710
+ * @param string $sql The SQL Query.
711
+ * @param WP_Query $query The WP_Query instance.
712
+ */
713
+ $sql = apply_filters( 'crp_query_posts_request', $sql, $query );
714
+
715
  return $sql;
716
  }
717
 
720
  *
721
  * @since 3.0.0
722
  *
723
+ * @param WP_Post[] $posts Array of post data.
724
+ * @param WP_Query $query The WP_Query instance.
725
+ * @return WP_Post[] Updated Array of post objects.
726
  */
727
  public function posts_pre_query( $posts, $query ) {
728
 
754
  }
755
  }
756
 
757
+ /**
758
+ * Filters the posts_pre_query of CRP_Query after processing and before returning.
759
+ *
760
+ * @since 3.2.0
761
+ *
762
+ * @param WP_Post[] $posts Array of post data.
763
+ * @param WP_Query $query The WP_Query instance.
764
+ */
765
+ $posts = apply_filters( 'crp_query_posts_pre_query', $posts, $query );
766
+
767
  return $posts;
768
  }
769
 
820
  $posts = array_merge( $extra_posts, $posts );
821
  }
822
 
823
+ /**
824
+ * Set the flag if CRP should fill random posts if there is a shortage of related posts.
825
+ *
826
+ * @since 3.2.0
827
+ *
828
+ * @param bool $fill_random_posts Fill random posts flag. Default false.
829
+ * @param WP_Post[] $posts Array of post objects.
830
+ * @param WP_Query $query The WP_Query instance.
831
+ */
832
+ $fill_random_posts = apply_filters( 'crp_fill_random_posts', false, $posts, $query );
833
+
834
+ if ( $fill_random_posts ) {
835
+ $no_of_random_posts = $this->query_args['limit'] - count( $posts );
836
+ if ( $no_of_random_posts > 0 ) {
837
+ $random_posts = get_posts(
838
+ array(
839
+ 'fields' => $query->get( 'fields' ),
840
+ 'orderby' => 'rand',
841
+ 'numberposts' => $no_of_random_posts,
842
+ 'post_type' => $query->get( 'post_type' ),
843
+ )
844
+ );
845
+ $posts = array_merge( $posts, $random_posts );
846
+ }
847
+ }
848
+
849
  /**
850
  * Filter array of WP_Post objects before it is returned to the CRP_Query instance.
851
  *
852
  * @since 1.9
853
  * @since 2.9.3 Added $args
854
  *
855
+ * @param WP_Post[] $posts Array of post objects.
856
+ * @param array $args Arguments array.
857
+ * @param WP_Query $query The WP_Query instance.
858
  */
859
+ return apply_filters( 'crp_query_the_posts', $posts, $this->query_args, $query );
860
  }
861
  }
862
  endif;
includes/header.php CHANGED
@@ -55,7 +55,7 @@ function crp_heading_styles() {
55
  $style = $style_array['name'];
56
  $extra_css = $style_array['extra_css'];
57
 
58
- wp_register_style( "crp-style-{$style}", plugins_url( "css/{$style}.min.css", CRP_PLUGIN_FILE ), array(), '1.0.1' );
59
  wp_enqueue_style( "crp-style-{$style}" );
60
  wp_add_inline_style( "crp-style-{$style}", $extra_css );
61
  }
@@ -131,5 +131,15 @@ function crp_get_style() {
131
  break;
132
  }
133
 
134
- return $style;
 
 
 
 
 
 
 
 
 
 
135
  }
55
  $style = $style_array['name'];
56
  $extra_css = $style_array['extra_css'];
57
 
58
+ wp_register_style( "crp-style-{$style}", plugins_url( "css/{$style}.min.css", CRP_PLUGIN_FILE ), array(), CRP_VERSION );
59
  wp_enqueue_style( "crp-style-{$style}" );
60
  wp_add_inline_style( "crp-style-{$style}", $extra_css );
61
  }
131
  break;
132
  }
133
 
134
+ /**
135
+ * Filter the style array which contains the name and extra_css.
136
+ *
137
+ * @since 3.2.0
138
+ *
139
+ * @param array $style Style array containing name and extra_css.
140
+ * @param string $crp_style Style name.
141
+ * @param int $thumb_width Thumbnail width.
142
+ * @param int $thumb_height Thumbnail height.
143
+ */
144
+ return apply_filters( 'crp_get_style', $style, $crp_style, $thumb_width, $thumb_height );
145
  }
includes/i10n.php CHANGED
@@ -13,7 +13,7 @@ if ( ! defined( 'WPINC' ) ) {
13
  /**
14
  * Initialises text domain for l10n.
15
  *
16
- * @since 2.2.0
17
  */
18
  function crp_lang_init() {
19
  load_plugin_textdomain( 'contextual-related-posts', false, dirname( plugin_basename( CRP_PLUGIN_FILE ) ) . '/languages/' );
@@ -25,11 +25,10 @@ add_action( 'plugins_loaded', 'crp_lang_init' );
25
  *
26
  * @since 3.0.0
27
  *
28
- * @param array $results Arry of Posts.
29
  * @return array Updated array of WP_Post objects.
30
  */
31
  function crp_translate_ids( $results ) {
32
- global $post;
33
 
34
  $processed_ids = array();
35
  $processed_results = array();
@@ -38,8 +37,8 @@ function crp_translate_ids( $results ) {
38
 
39
  $result = crp_object_id_cur_lang( $result );
40
 
41
- // If this is NULL or already processed ID or matches current post then skip processing this loop.
42
- if ( ! $result->ID || in_array( $result->ID, $processed_ids ) || intval( $result->ID ) === intval( $post->ID ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
43
  continue;
44
  }
45
 
@@ -84,8 +83,8 @@ function crp_object_id_cur_lang( $post ) {
84
  *
85
  * @since 2.2.3
86
  *
87
- * @param bool $return_original_if_missing
88
- * @param int $post->ID Post ID
89
  */
90
  $return_original_if_missing = apply_filters( 'crp_wpml_return_original', $return_original_if_missing, $post->ID );
91
 
@@ -94,11 +93,11 @@ function crp_object_id_cur_lang( $post ) {
94
  }
95
 
96
  /**
97
- * Filters object ID for current language (WPML).
98
  *
99
- * @since 2.1.0
100
  *
101
- * @param int $post->ID Post ID
102
  */
103
  return apply_filters( 'crp_object_id_cur_lang', $post );
104
  }
13
  /**
14
  * Initialises text domain for l10n.
15
  *
16
+ * @since 2.2.0
17
  */
18
  function crp_lang_init() {
19
  load_plugin_textdomain( 'contextual-related-posts', false, dirname( plugin_basename( CRP_PLUGIN_FILE ) ) . '/languages/' );
25
  *
26
  * @since 3.0.0
27
  *
28
+ * @param array $results Array of Posts.
29
  * @return array Updated array of WP_Post objects.
30
  */
31
  function crp_translate_ids( $results ) {
 
32
 
33
  $processed_ids = array();
34
  $processed_results = array();
37
 
38
  $result = crp_object_id_cur_lang( $result );
39
 
40
+ // If this is NULL or already processed ID then skip processing this loop.
41
+ if ( ! $result->ID || in_array( $result->ID, $processed_ids ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
42
  continue;
43
  }
44
 
83
  *
84
  * @since 2.2.3
85
  *
86
+ * @param bool $return_original_if_missing Flag to return original post ID if translated post ID is missing.
87
+ * @param int $id Post ID
88
  */
89
  $return_original_if_missing = apply_filters( 'crp_wpml_return_original', $return_original_if_missing, $post->ID );
90
 
93
  }
94
 
95
  /**
96
+ * Filters post object for current language.
97
  *
98
+ * @since 2.1.0
99
  *
100
+ * @param WP_Post $id Post object.
101
  */
102
  return apply_filters( 'crp_object_id_cur_lang', $post );
103
  }
includes/main-query.php CHANGED
@@ -34,7 +34,7 @@ function get_crp( $args = array() ) {
34
  'extra_class' => '',
35
  'more_link_text' => '',
36
  );
37
- $defaults = array_merge( $defaults, $crp_settings );
38
 
39
  // Parse incomming $args into an array and merge it with $defaults.
40
  $args = wp_parse_args( $args, $defaults );
@@ -108,22 +108,29 @@ function get_crp( $args = array() ) {
108
  return $custom_template;
109
  }
110
 
111
- $widget_class = $args['is_widget'] ? 'crp_related_widget ' : 'crp_related ';
112
- $shortcode_class = $args['is_shortcode'] ? 'crp_related_shortcode ' : '';
113
- $block_class = $args['is_block'] ? 'crp_related_block ' : '';
114
-
115
- $post_classes = $widget_class . $shortcode_class . $block_class . ' ' . $args['extra_class'];
 
 
 
 
 
116
 
117
  /**
118
  * Filter the classes added to the div wrapper of the Contextual Related Posts.
119
  *
120
  * @since 2.2.3
121
  * @since 2.9.3 Added $args
 
122
  *
123
- * @param string $post_classes Post classes string.
124
- * @param array $args Arguments array.
 
125
  */
126
- $post_classes = apply_filters( 'crp_post_class', $post_classes, $args );
127
 
128
  $output = '<div class="' . $post_classes . '">';
129
 
@@ -146,11 +153,18 @@ function get_crp( $args = array() ) {
146
  $output .= crp_author( $args, $result );
147
  }
148
 
149
- if ( $args['show_date'] ) {
150
- $output .= '<span class="crp_date"> ' . mysql2date( get_option( 'date_format', 'd/m/y' ), $result->post_date ) . '</span> ';
 
 
 
 
 
 
 
151
  }
152
 
153
- if ( $args['show_excerpt'] ) {
154
  $output .= '<span class="crp_excerpt"> ' . crp_excerpt( $result->ID, $args['excerpt_length'], true, $args['more_link_text'] ) . '</span>';
155
  }
156
 
34
  'extra_class' => '',
35
  'more_link_text' => '',
36
  );
37
+ $defaults = array_merge( $defaults, crp_settings_defaults(), $crp_settings );
38
 
39
  // Parse incomming $args into an array and merge it with $defaults.
40
  $args = wp_parse_args( $args, $defaults );
108
  return $custom_template;
109
  }
110
 
111
+ $style_array = crp_get_style();
112
+ $post_classes = array(
113
+ 'main' => 'crp_related',
114
+ 'widget' => $args['is_widget'] ? 'crp_related_widget' : '',
115
+ 'shortcode' => $args['is_shortcode'] ? 'crp_related_shortcode ' : '',
116
+ 'block' => $args['is_block'] ? 'crp_related_block ' : '',
117
+ 'extra_class' => $args['extra_class'],
118
+ 'style' => ! empty( $style_array['name'] ) ? 'crp-' . $style_array['name'] : '',
119
+ );
120
+ $post_classes = join( ' ', $post_classes );
121
 
122
  /**
123
  * Filter the classes added to the div wrapper of the Contextual Related Posts.
124
  *
125
  * @since 2.2.3
126
  * @since 2.9.3 Added $args
127
+ * @since 3.2.0 Added $post
128
  *
129
+ * @param string $post_classes Post classes string.
130
+ * @param array $args Arguments array.
131
+ * @param WP_Post $post WP_Post object.
132
  */
133
+ $post_classes = apply_filters( 'crp_post_class', $post_classes, $args, $post );
134
 
135
  $output = '<div class="' . $post_classes . '">';
136
 
153
  $output .= crp_author( $args, $result );
154
  }
155
 
156
+ if ( ! empty( $args['show_date'] ) ) {
157
+ $output .= '<span class="crp_date"> ' . crp_date( $args, $result ) . '</span> ';
158
+ }
159
+
160
+ if ( ! empty( $args['show_primary_term'] ) ) {
161
+ $post_taxonomies = get_object_taxonomies( $result );
162
+ if ( ! empty( $post_taxonomies[0] ) ) {
163
+ $output .= '<span class="crp_primary_term"> ' . crp_get_primary_term_name( $result, $post_taxonomies[0] ) . '</span> ';
164
+ }
165
  }
166
 
167
+ if ( ! empty( $args['show_excerpt'] ) ) {
168
  $output .= '<span class="crp_excerpt"> ' . crp_excerpt( $result->ID, $args['excerpt_length'], true, $args['more_link_text'] ) . '</span>';
169
  }
170
 
includes/media.php CHANGED
@@ -474,7 +474,7 @@ function crp_get_attachment_id_from_url( $attachment_url = '' ) {
474
  /**
475
  * Function to get the correct height and width of the thumbnail.
476
  *
477
- * @since 2.9.0
478
  * @since 3.1.0 First argument is a string.
479
  *
480
  * @param string $size Image size.
474
  /**
475
  * Function to get the correct height and width of the thumbnail.
476
  *
477
+ * @since 2.9.0
478
  * @since 3.1.0 First argument is a string.
479
  *
480
  * @param string $size Image size.
includes/modules/class-crp-widget.php CHANGED
@@ -42,19 +42,18 @@ if ( ! class_exists( 'CRP_Widget' ) ) :
42
  * @param array $instance Previously saved values from database.
43
  */
44
  public function form( $instance ) {
45
- $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
46
- $limit = isset( $instance['limit'] ) ? esc_attr( $instance['limit'] ) : '';
47
- $offset = isset( $instance['offset'] ) ? esc_attr( $instance['offset'] ) : '';
48
- $show_excerpt = isset( $instance['show_excerpt'] ) ? esc_attr( $instance['show_excerpt'] ) : '';
49
- $show_author = isset( $instance['show_author'] ) ? esc_attr( $instance['show_author'] ) : '';
50
- $show_date = isset( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : '';
51
- $post_thumb_op = isset( $instance['post_thumb_op'] ) ? esc_attr( $instance['post_thumb_op'] ) : '';
52
- $thumb_height = isset( $instance['thumb_height'] ) ? esc_attr( $instance['thumb_height'] ) : '';
53
- $thumb_width = isset( $instance['thumb_width'] ) ? esc_attr( $instance['thumb_width'] ) : '';
54
- $ordering = isset( $instance['ordering'] ) ? esc_attr( $instance['ordering'] ) : '';
55
- $random_order = isset( $instance['random_order'] ) ? esc_attr( $instance['random_order'] ) : '';
56
- $include_categories = isset( $instance['include_categories'] ) ? esc_attr( $instance['include_categories'] ) : '';
57
- $include_cat_ids = isset( $instance['include_cat_ids'] ) ? esc_attr( $instance['include_cat_ids'] ) : '';
58
 
59
  // Parse the Post types.
60
  $post_types = array();
@@ -77,91 +76,90 @@ if ( ! class_exists( 'CRP_Widget' ) ) :
77
  $orderings = crp_get_orderings();
78
 
79
  ?>
80
- <p>
81
- <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
82
- <?php esc_html_e( 'Title', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
83
- </label>
84
- </p>
85
- <p>
86
- <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>">
87
- <?php esc_html_e( 'No. of posts', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" type="text" value="<?php echo esc_attr( $limit ); ?>" />
88
- </label>
89
- </p>
90
- <p>
91
- <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>">
92
- <?php esc_html_e( 'Offset', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'offset' ) ); ?>" type="text" value="<?php echo esc_attr( $offset ); ?>" />
93
- </label>
94
- </p>
95
- <p>
96
- <label for="<?php echo esc_attr( $this->get_field_id( 'show_excerpt' ) ); ?>">
97
- <input id="<?php echo esc_attr( $this->get_field_id( 'show_excerpt' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_excerpt' ) ); ?>" type="checkbox" <?php checked( true, $show_excerpt, true ); ?> /> <?php esc_html_e( ' Show excerpt?', 'contextual-related-posts' ); ?>
98
- </label>
99
- </p>
100
- <p>
101
- <label for="<?php echo esc_attr( $this->get_field_id( 'show_author' ) ); ?>">
102
- <input id="<?php echo esc_attr( $this->get_field_id( 'show_author' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_author' ) ); ?>" type="checkbox" <?php checked( true, $show_author, true ); ?> /> <?php esc_html_e( ' Show author?', 'contextual-related-posts' ); ?>
103
- </label>
104
- </p>
105
- <p>
106
- <label for="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>">
107
- <input id="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>" type="checkbox" <?php checked( true, $show_date, true ); ?> /> <?php esc_html_e( ' Show date?', 'contextual-related-posts' ); ?>
108
- </label>
109
- </p>
110
- <p>
111
- <?php esc_html_e( 'Thumbnail options', 'contextual-related-posts' ); ?>: <br />
112
- <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'post_thumb_op' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_thumb_op' ) ); ?>">
113
- <option value="inline" <?php selected( 'inline', $post_thumb_op, true ); ?>><?php esc_html_e( 'Thumbnails inline, before title', 'contextual-related-posts' ); ?></option>
114
- <option value="after" <?php selected( 'after', $post_thumb_op, true ); ?>><?php esc_html_e( 'Thumbnails inline, after title', 'contextual-related-posts' ); ?></option>
115
- <option value="thumbs_only" <?php selected( 'thumbs_only', $post_thumb_op, true ); ?>><?php esc_html_e( 'Only thumbnails, no text', 'contextual-related-posts' ); ?></option>
116
- <option value="text_only" <?php selected( 'text_only', $post_thumb_op, true ); ?>><?php esc_html_e( 'No thumbnails, only text.', 'contextual-related-posts' ); ?></option>
117
- </select>
118
- </p>
119
- <p>
120
- <label for="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>">
121
- <?php esc_html_e( 'Thumbnail height', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_height' ) ); ?>" type="text" value="<?php echo esc_attr( $thumb_height ); ?>" />
122
- </label>
123
- </p>
124
- <p>
125
- <label for="<?php echo esc_attr( $this->get_field_id( 'thumb_width' ) ); ?>">
126
- <?php esc_html_e( 'Thumbnail width', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'thumb_width' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_width' ) ); ?>" type="text" value="<?php echo esc_attr( $thumb_width ); ?>" />
127
- </label>
128
- </p>
129
- <p><?php esc_html_e( 'Order posts', 'contextual-related-posts' ); ?>:<br />
130
-
131
- <?php foreach ( $orderings as $order => $label ) { ?>
132
-
133
- <label>
134
- <input id="<?php echo esc_attr( $this->get_field_id( 'ordering' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'ordering' ) ); ?>" type="radio" value="<?php echo esc_attr( $order ); ?>" <?php checked( $order === $ordering ); ?> />
135
- <?php echo esc_attr( $label ); ?>
136
  </label>
137
- <br />
138
-
139
- <?php } ?>
140
- </p>
141
- <p>
142
- <label for="<?php echo esc_attr( $this->get_field_id( 'random_order' ) ); ?>">
143
- <input id="<?php echo esc_attr( $this->get_field_id( 'random_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'random_order' ) ); ?>" type="checkbox" <?php checked( true, $random_order, true ); ?> /> <?php esc_html_e( ' Randomize posts', 'contextual-related-posts' ); ?>
144
- </label>
145
- </p>
146
- <p>
147
- <label for="<?php echo esc_attr( $this->get_field_id( 'include_categories' ) ); ?>">
148
- <?php esc_html_e( 'Only from categories', 'top-10' ); ?>:
149
- <input class="widefat category_autocomplete" id="<?php echo esc_attr( $this->get_field_id( 'include_categories' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'include_categories' ) ); ?>" type="text" value="<?php echo esc_attr( $include_categories ); ?>" />
150
- </label>
151
- <input type="hidden" id="<?php echo esc_attr( $this->get_field_id( 'include_cat_ids' ) ); ?>" name="<?php echo esc_attr( $this->get_field_id( 'include_cat_ids' ) ); ?>" value="<?php echo esc_attr( $include_cat_ids ); ?>" />
152
- </p>
153
- <p><?php esc_html_e( 'Post types to include', 'contextual-related-posts' ); ?>:<br />
154
-
155
- <?php foreach ( $wp_post_types as $wp_post_type ) { ?>
156
-
157
- <label>
158
- <input id="<?php echo esc_attr( $this->get_field_id( 'post_types' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_types' ) ); ?>[]" type="checkbox" value="<?php echo esc_attr( $wp_post_type ); ?>" <?php checked( true, in_array( $wp_post_type, $posts_types_inc, true ) ); ?> />
159
- <?php echo esc_attr( $wp_post_type ); ?>
160
  </label>
161
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
- <?php } ?>
164
- </p>
 
 
 
 
 
 
165
 
166
  <?php
167
  /**
@@ -213,10 +211,10 @@ if ( ! class_exists( 'CRP_Widget' ) ) :
213
  $instance['post_types'] = implode( ',', $post_types );
214
 
215
  // Save include_categories.
216
- $include_categories = array_unique( str_getcsv( $new_instance['include_categories'] ) );
217
 
218
  foreach ( $include_categories as $cat_name ) {
219
- $cat = get_term_by( 'name', $cat_name, 'category' );
220
 
221
  if ( isset( $cat->term_taxonomy_id ) ) {
222
  $include_cat_ids[] = $cat->term_taxonomy_id;
@@ -334,13 +332,15 @@ if ( ! class_exists( 'CRP_Widget' ) ) :
334
  */
335
  $arguments = apply_filters( 'crp_widget_options', $arguments, $args, $instance, $this->id_base );
336
 
337
- $output = $args['before_widget'];
338
- $output .= $args['before_title'] . $title . $args['after_title'];
339
- $output .= get_crp( $arguments );
340
-
341
- $output .= $args['after_widget'];
 
342
 
343
- echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
 
344
  }// End if.
345
  } // Ending function widget.
346
  }
42
  * @param array $instance Previously saved values from database.
43
  */
44
  public function form( $instance ) {
45
+ $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
46
+ $limit = isset( $instance['limit'] ) ? esc_attr( $instance['limit'] ) : '';
47
+ $offset = isset( $instance['offset'] ) ? esc_attr( $instance['offset'] ) : '';
48
+ $show_excerpt = isset( $instance['show_excerpt'] ) ? esc_attr( $instance['show_excerpt'] ) : '';
49
+ $show_author = isset( $instance['show_author'] ) ? esc_attr( $instance['show_author'] ) : '';
50
+ $show_date = isset( $instance['show_date'] ) ? esc_attr( $instance['show_date'] ) : '';
51
+ $post_thumb_op = isset( $instance['post_thumb_op'] ) ? esc_attr( $instance['post_thumb_op'] ) : '';
52
+ $thumb_height = isset( $instance['thumb_height'] ) ? esc_attr( $instance['thumb_height'] ) : '';
53
+ $thumb_width = isset( $instance['thumb_width'] ) ? esc_attr( $instance['thumb_width'] ) : '';
54
+ $ordering = isset( $instance['ordering'] ) ? esc_attr( $instance['ordering'] ) : '';
55
+ $random_order = isset( $instance['random_order'] ) ? esc_attr( $instance['random_order'] ) : '';
56
+ $include_cat_ids = isset( $instance['include_cat_ids'] ) ? esc_attr( $instance['include_cat_ids'] ) : '';
 
57
 
58
  // Parse the Post types.
59
  $post_types = array();
76
  $orderings = crp_get_orderings();
77
 
78
  ?>
79
+ <p>
80
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
81
+ <?php esc_html_e( 'Title', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  </label>
83
+ </p>
84
+ <p>
85
+ <label for="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>">
86
+ <?php esc_html_e( 'No. of posts', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'limit' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'limit' ) ); ?>" type="text" value="<?php echo esc_attr( $limit ); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  </label>
88
+ </p>
89
+ <p>
90
+ <label for="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>">
91
+ <?php esc_html_e( 'Offset', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'offset' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'offset' ) ); ?>" type="text" value="<?php echo esc_attr( $offset ); ?>" />
92
+ </label>
93
+ </p>
94
+ <p>
95
+ <label for="<?php echo esc_attr( $this->get_field_id( 'show_excerpt' ) ); ?>">
96
+ <input id="<?php echo esc_attr( $this->get_field_id( 'show_excerpt' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_excerpt' ) ); ?>" type="checkbox" <?php checked( true, $show_excerpt, true ); ?> /> <?php esc_html_e( ' Show excerpt?', 'contextual-related-posts' ); ?>
97
+ </label>
98
+ </p>
99
+ <p>
100
+ <label for="<?php echo esc_attr( $this->get_field_id( 'show_author' ) ); ?>">
101
+ <input id="<?php echo esc_attr( $this->get_field_id( 'show_author' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_author' ) ); ?>" type="checkbox" <?php checked( true, $show_author, true ); ?> /> <?php esc_html_e( ' Show author?', 'contextual-related-posts' ); ?>
102
+ </label>
103
+ </p>
104
+ <p>
105
+ <label for="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>">
106
+ <input id="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>" type="checkbox" <?php checked( true, $show_date, true ); ?> /> <?php esc_html_e( ' Show date?', 'contextual-related-posts' ); ?>
107
+ </label>
108
+ </p>
109
+ <p>
110
+ <?php esc_html_e( 'Thumbnail options', 'contextual-related-posts' ); ?>: <br />
111
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'post_thumb_op' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_thumb_op' ) ); ?>">
112
+ <option value="inline" <?php selected( 'inline', $post_thumb_op, true ); ?>><?php esc_html_e( 'Thumbnails inline, before title', 'contextual-related-posts' ); ?></option>
113
+ <option value="after" <?php selected( 'after', $post_thumb_op, true ); ?>><?php esc_html_e( 'Thumbnails inline, after title', 'contextual-related-posts' ); ?></option>
114
+ <option value="thumbs_only" <?php selected( 'thumbs_only', $post_thumb_op, true ); ?>><?php esc_html_e( 'Only thumbnails, no text', 'contextual-related-posts' ); ?></option>
115
+ <option value="text_only" <?php selected( 'text_only', $post_thumb_op, true ); ?>><?php esc_html_e( 'No thumbnails, only text.', 'contextual-related-posts' ); ?></option>
116
+ </select>
117
+ </p>
118
+ <p>
119
+ <label for="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>">
120
+ <?php esc_html_e( 'Thumbnail height', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'thumb_height' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_height' ) ); ?>" type="text" value="<?php echo esc_attr( $thumb_height ); ?>" />
121
+ </label>
122
+ </p>
123
+ <p>
124
+ <label for="<?php echo esc_attr( $this->get_field_id( 'thumb_width' ) ); ?>">
125
+ <?php esc_html_e( 'Thumbnail width', 'contextual-related-posts' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'thumb_width' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'thumb_width' ) ); ?>" type="text" value="<?php echo esc_attr( $thumb_width ); ?>" />
126
+ </label>
127
+ </p>
128
+ <p><?php esc_html_e( 'Order posts', 'contextual-related-posts' ); ?>:<br />
129
+
130
+ <?php foreach ( $orderings as $order => $label ) { ?>
131
+
132
+ <label>
133
+ <input id="<?php echo esc_attr( $this->get_field_id( 'ordering' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'ordering' ) ); ?>" type="radio" value="<?php echo esc_attr( $order ); ?>" <?php checked( $order === $ordering ); ?> />
134
+ <?php echo esc_attr( $label ); ?>
135
+ </label>
136
+ <br />
137
+
138
+ <?php } ?>
139
+ </p>
140
+ <p>
141
+ <label for="<?php echo esc_attr( $this->get_field_id( 'random_order' ) ); ?>">
142
+ <input id="<?php echo esc_attr( $this->get_field_id( 'random_order' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'random_order' ) ); ?>" type="checkbox" <?php checked( true, $random_order, true ); ?> /> <?php esc_html_e( ' Randomize posts', 'contextual-related-posts' ); ?>
143
+ </label>
144
+ </p>
145
+ <p>
146
+ <label for="<?php echo esc_attr( $this->get_field_id( 'include_cat_ids' ) ); ?>">
147
+ <?php esc_html_e( 'Only from categories (comma-separated list of term taxonomy IDs)', 'contextual-related-posts' ); ?>:
148
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'include_cat_ids' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'include_cat_ids' ) ); ?>" type="text" value="<?php echo esc_attr( $include_cat_ids ); ?>" />
149
+ </label>
150
+ </p>
151
+ <p><?php esc_html_e( 'Post types to include', 'contextual-related-posts' ); ?>:<br />
152
+
153
+ <?php foreach ( $wp_post_types as $wp_post_type ) { ?>
154
 
155
+ <label>
156
+ <input id="<?php echo esc_attr( $this->get_field_id( 'post_types' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_types' ) ); ?>[]" type="checkbox" value="<?php echo esc_attr( $wp_post_type ); ?>" <?php checked( true, in_array( $wp_post_type, $posts_types_inc, true ) ); ?> />
157
+ <?php echo esc_attr( $wp_post_type ); ?>
158
+ </label>
159
+ <br />
160
+
161
+ <?php } ?>
162
+ </p>
163
 
164
  <?php
165
  /**
211
  $instance['post_types'] = implode( ',', $post_types );
212
 
213
  // Save include_categories.
214
+ $include_categories = wp_parse_id_list( $new_instance['include_cat_ids'] );
215
 
216
  foreach ( $include_categories as $cat_name ) {
217
+ $cat = get_term_by( 'term_taxonomy_id', $cat_name );
218
 
219
  if ( isset( $cat->term_taxonomy_id ) ) {
220
  $include_cat_ids[] = $cat->term_taxonomy_id;
332
  */
333
  $arguments = apply_filters( 'crp_widget_options', $arguments, $args, $instance, $this->id_base );
334
 
335
+ $related_posts = get_crp( $arguments );
336
+ if ( ! empty( wp_strip_all_tags( $related_posts, true ) ) ) {
337
+ $output = $args['before_widget'];
338
+ $output .= $args['before_title'] . $title . $args['after_title'];
339
+ $output .= $related_posts;
340
+ $output .= $args['after_widget'];
341
 
342
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
343
+ }
344
  }// End if.
345
  } // Ending function widget.
346
  }
includes/modules/exclusions.php CHANGED
@@ -15,10 +15,12 @@ if ( ! defined( 'WPINC' ) ) {
15
  *
16
  * @since 2.3.0
17
  *
18
- * @param array $exclude_post_ids Original excluded post IDs.
 
 
19
  * @return array Updated excluded post ID
20
  */
21
- function crp_exclude_post_ids( $exclude_post_ids ) {
22
  global $wpdb;
23
 
24
  $exclude_post_ids = (array) $exclude_post_ids;
@@ -31,11 +33,14 @@ function crp_exclude_post_ids( $exclude_post_ids ) {
31
  if ( isset( $meta_value['exclude_this_post'] ) && $meta_value['exclude_this_post'] ) {
32
  $exclude_post_ids[] = $crp_post_meta['post_id'];
33
  }
 
 
 
34
  }
35
  return $exclude_post_ids;
36
 
37
  }
38
- add_filter( 'crp_exclude_post_ids', 'crp_exclude_post_ids' );
39
 
40
 
41
  /**
15
  *
16
  * @since 2.3.0
17
  *
18
+ * @param array $exclude_post_ids Original excluded post IDs.
19
+ * @param array $args Arguments array.
20
+ * @param WP_Post $post Source post.
21
  * @return array Updated excluded post ID
22
  */
23
+ function crp_exclude_post_ids( $exclude_post_ids, $args, $post ) {
24
  global $wpdb;
25
 
26
  $exclude_post_ids = (array) $exclude_post_ids;
33
  if ( isset( $meta_value['exclude_this_post'] ) && $meta_value['exclude_this_post'] ) {
34
  $exclude_post_ids[] = $crp_post_meta['post_id'];
35
  }
36
+ if ( (int) $post->ID === (int) $crp_post_meta['post_id'] && isset( $meta_value['exclude_post_ids'] ) && $meta_value['exclude_post_ids'] ) {
37
+ $exclude_post_ids = array_merge( $exclude_post_ids, explode( ',', $meta_value['exclude_post_ids'] ) );
38
+ }
39
  }
40
  return $exclude_post_ids;
41
 
42
  }
43
+ add_filter( 'crp_exclude_post_ids', 'crp_exclude_post_ids', 10, 3 );
44
 
45
 
46
  /**
includes/output-generator.php CHANGED
@@ -13,12 +13,14 @@ if ( ! defined( 'WPINC' ) ) {
13
  /**
14
  * Returns the link attributes.
15
  *
16
- * @since 2.2.0
 
17
  *
18
- * @param array $args Array of arguments.
 
19
  * @return string Space separated list of link attributes.
20
  */
21
- function crp_link_attributes( $args ) {
22
 
23
  $rel_attribute = ( $args['link_nofollow'] ) ? ' rel="nofollow" ' : ' ';
24
  $target_attribute = ( $args['link_new_window'] ) ? ' target="_blank" ' : ' ';
@@ -31,12 +33,14 @@ function crp_link_attributes( $args ) {
31
  /**
32
  * Filter the title of the Related Posts list
33
  *
34
- * @since 2.2.0
 
35
  *
36
- * @param array $link_attributes Array of link attributes
37
- * @param array $args Array of arguments
 
38
  */
39
- $link_attributes = apply_filters( 'crp_link_attributes', $link_attributes, $args );
40
 
41
  // Convert it to a string.
42
  $link_attributes = implode( ' ', $link_attributes );
@@ -130,8 +134,8 @@ function crp_after_list( $args ) {
130
  *
131
  * @since 2.2.0
132
  *
133
- * @param array $args Array of arguments.
134
- * @param object $result Object of the current post result.
135
  * @return string Space separated list of link attributes
136
  */
137
  function crp_before_list_item( $args, $result ) {
@@ -143,9 +147,9 @@ function crp_before_list_item( $args, $result ) {
143
  *
144
  * @since 1.9
145
  *
146
- * @param string $before_list_item Tag before each list item. Can be defined in the Settings page.
147
- * @param object $result Object of the current post result
148
- * @param array $args Array of arguments
149
  */
150
  return apply_filters( 'crp_before_list_item', $before_list_item, $result, $args );
151
 
@@ -157,8 +161,8 @@ function crp_before_list_item( $args, $result ) {
157
  *
158
  * @since 2.2.0
159
  *
160
- * @param array $args Array of arguments.
161
- * @param object $result Object of the current post result.
162
  * @return string Space separated list of link attributes
163
  */
164
  function crp_after_list_item( $args, $result ) {
@@ -184,8 +188,8 @@ function crp_after_list_item( $args, $result ) {
184
  *
185
  * @since 2.2.0
186
  *
187
- * @param array $args Array of arguments.
188
- * @param object $result Object of the current post result.
189
  * @return string Space separated list of link attributes
190
  */
191
  function crp_title( $args, $result ) {
@@ -198,7 +202,7 @@ function crp_title( $args, $result ) {
198
  * @since 1.9
199
  *
200
  * @param string $title Title of the post.
201
- * @param object $result Object of the current post result
202
  * @param array $args Array of arguments
203
  */
204
  return apply_filters( 'crp_title', $title, $result, $args );
@@ -211,8 +215,8 @@ function crp_title( $args, $result ) {
211
  *
212
  * @since 2.2.0
213
  *
214
- * @param array $args Array of arguments.
215
- * @param object $result Object of the current post result.
216
  * @return string Space separated list of link attributes
217
  */
218
  function crp_author( $args, $result ) {
@@ -244,7 +248,7 @@ function crp_author( $args, $result ) {
244
  *
245
  * @param string $crp_author Formatted string with author details and link
246
  * @param object $author_info WP_User object of the post author
247
- * @param object $result Object of the current post result
248
  * @param array $args Array of arguments
249
  */
250
  return apply_filters( 'crp_author', $crp_author, $author_info, $result, $args );
@@ -257,8 +261,8 @@ function crp_author( $args, $result ) {
257
  *
258
  * @since 2.5.0
259
  *
260
- * @param array $args Array of arguments.
261
- * @param object $result Object of the current post result.
262
  * @return string Space separated list of link attributes
263
  */
264
  function crp_permalink( $args, $result ) {
@@ -271,7 +275,7 @@ function crp_permalink( $args, $result ) {
271
  * @since 2.5.0
272
  *
273
  * @param string $title Permalink of the post.
274
- * @param object $result Object of the current post result
275
  * @param array $args Array of arguments
276
  */
277
  return apply_filters( 'crp_permalink', $link, $result, $args );
@@ -284,8 +288,8 @@ function crp_permalink( $args, $result ) {
284
  *
285
  * @since 2.2.0
286
  *
287
- * @param array $args Array of arguments.
288
- * @param object $result Object of the current post result.
289
  * @return string Space separated list of link attributes
290
  */
291
  function crp_list_link( $args, $result ) {
@@ -293,7 +297,7 @@ function crp_list_link( $args, $result ) {
293
  $output = '';
294
  $title = crp_title( $args, $result );
295
  $link = crp_permalink( $args, $result );
296
- $link_attributes = crp_link_attributes( $args );
297
 
298
  $output .= '<a href="' . $link . '" ' . $link_attributes . ' class="crp_link ' . $result->post_type . '-' . $result->ID . '">';
299
 
@@ -330,9 +334,57 @@ function crp_list_link( $args, $result ) {
330
  * @since 2.2.0
331
  *
332
  * @param string $output Formatted list item with link and and thumbnail
333
- * @param object $result Object of the current post result
334
  * @param array $args Array of arguments
335
  */
336
  return apply_filters( 'crp_list_link', $output, $result, $args );
 
 
 
 
 
 
 
 
 
 
 
 
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  }
13
  /**
14
  * Returns the link attributes.
15
  *
16
+ * @since 2.2.0
17
+ * @since 3.2.0 Added $result parameter
18
  *
19
+ * @param array $args Array of arguments.
20
+ * @param WP_Post $result WP_Post object.
21
  * @return string Space separated list of link attributes.
22
  */
23
+ function crp_link_attributes( $args, $result ) {
24
 
25
  $rel_attribute = ( $args['link_nofollow'] ) ? ' rel="nofollow" ' : ' ';
26
  $target_attribute = ( $args['link_new_window'] ) ? ' target="_blank" ' : ' ';
33
  /**
34
  * Filter the title of the Related Posts list
35
  *
36
+ * @since 2.2.0
37
+ * @since 3.2.0 Added $result parameter
38
  *
39
+ * @param array $link_attributes Array of link attributes
40
+ * @param array $args Array of arguments
41
+ * @param WP_Post $result WP_Post object.
42
  */
43
+ $link_attributes = apply_filters( 'crp_link_attributes', $link_attributes, $args, $result );
44
 
45
  // Convert it to a string.
46
  $link_attributes = implode( ' ', $link_attributes );
134
  *
135
  * @since 2.2.0
136
  *
137
+ * @param array $args Array of arguments.
138
+ * @param WP_Post $result WP_Post object.
139
  * @return string Space separated list of link attributes
140
  */
141
  function crp_before_list_item( $args, $result ) {
147
  *
148
  * @since 1.9
149
  *
150
+ * @param string $before_list_item Tag before each list item. Can be defined in the Settings page.
151
+ * @param WP_Post $result WP_Post object.
152
+ * @param array $args Array of arguments
153
  */
154
  return apply_filters( 'crp_before_list_item', $before_list_item, $result, $args );
155
 
161
  *
162
  * @since 2.2.0
163
  *
164
+ * @param array $args Array of arguments.
165
+ * @param WP_Post $result WP_Post object.
166
  * @return string Space separated list of link attributes
167
  */
168
  function crp_after_list_item( $args, $result ) {
188
  *
189
  * @since 2.2.0
190
  *
191
+ * @param array $args Array of arguments.
192
+ * @param WP_Post $result WP_Post object.
193
  * @return string Space separated list of link attributes
194
  */
195
  function crp_title( $args, $result ) {
202
  * @since 1.9
203
  *
204
  * @param string $title Title of the post.
205
+ * @param WP_Post $result WP_Post object.
206
  * @param array $args Array of arguments
207
  */
208
  return apply_filters( 'crp_title', $title, $result, $args );
215
  *
216
  * @since 2.2.0
217
  *
218
+ * @param array $args Array of arguments.
219
+ * @param WP_Post $result WP_Post object.
220
  * @return string Space separated list of link attributes
221
  */
222
  function crp_author( $args, $result ) {
248
  *
249
  * @param string $crp_author Formatted string with author details and link
250
  * @param object $author_info WP_User object of the post author
251
+ * @param WP_Post $result WP_Post object.
252
  * @param array $args Array of arguments
253
  */
254
  return apply_filters( 'crp_author', $crp_author, $author_info, $result, $args );
261
  *
262
  * @since 2.5.0
263
  *
264
+ * @param array $args Array of arguments.
265
+ * @param WP_Post $result WP_Post object.
266
  * @return string Space separated list of link attributes
267
  */
268
  function crp_permalink( $args, $result ) {
275
  * @since 2.5.0
276
  *
277
  * @param string $title Permalink of the post.
278
+ * @param WP_Post $result WP_Post object.
279
  * @param array $args Array of arguments
280
  */
281
  return apply_filters( 'crp_permalink', $link, $result, $args );
288
  *
289
  * @since 2.2.0
290
  *
291
+ * @param array $args Array of arguments.
292
+ * @param WP_Post $result WP_Post object.
293
  * @return string Space separated list of link attributes
294
  */
295
  function crp_list_link( $args, $result ) {
297
  $output = '';
298
  $title = crp_title( $args, $result );
299
  $link = crp_permalink( $args, $result );
300
+ $link_attributes = crp_link_attributes( $args, $result );
301
 
302
  $output .= '<a href="' . $link . '" ' . $link_attributes . ' class="crp_link ' . $result->post_type . '-' . $result->ID . '">';
303
 
334
  * @since 2.2.0
335
  *
336
  * @param string $output Formatted list item with link and and thumbnail
337
+ * @param WP_Post $result WP_Post object.
338
  * @param array $args Array of arguments
339
  */
340
  return apply_filters( 'crp_list_link', $output, $result, $args );
341
+ }
342
+
343
+ /**
344
+ * Returns the date.
345
+ *
346
+ * @since 3.2.0
347
+ *
348
+ * @param array $args Array of arguments.
349
+ * @param WP_Post $result WP_Post object.
350
+ * @return string Space separated list of link attributes
351
+ */
352
+ function crp_date( $args, $result ) {
353
 
354
+ $output = mysql2date( get_option( 'date_format', 'd/m/y' ), $result->post_date );
355
+
356
+ /**
357
+ * Filter Formatted list item with link and and thumbnail.
358
+ *
359
+ * @since 3.2.0
360
+ *
361
+ * @param string $output Formatted list item with link and and thumbnail
362
+ * @param WP_Post $result WP_Post object.
363
+ * @param array $args Array of arguments
364
+ */
365
+ return apply_filters( 'crp_date', $output, $result, $args );
366
+ }
367
+
368
+
369
+ /**
370
+ * Display the primary term for a given post.
371
+ *
372
+ * @since 3.2.0
373
+ *
374
+ * @param int|WP_Post $post Post ID or WP_Post object.
375
+ * @param string $term Term name.
376
+ * @param bool $echo Echo or return.
377
+ * @return string Term name if $echo is true, void if false.
378
+ */
379
+ function crp_get_primary_term_name( $post, $term = 'category', $echo = false ) {
380
+ $output = '';
381
+ $primary_term = crp_get_primary_term( $post, $term );
382
+ if ( ! empty( $primary_term['primary'] ) ) {
383
+ $output = $primary_term['primary']->name;
384
+ }
385
+ if ( $echo ) {
386
+ echo esc_html( $output );
387
+ } else {
388
+ return $output;
389
+ }
390
  }
includes/tools.php CHANGED
@@ -293,3 +293,83 @@ function crp_str_putcsv( $array, $delimiter = ',', $enclosure = '"', $terminator
293
  return $string;
294
  }
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  return $string;
294
  }
295
 
296
+ /**
297
+ * Get the primary term for a given post.
298
+ *
299
+ * @since 3.2.0
300
+ *
301
+ * @param int|WP_Post $post Post ID or WP_Post object.
302
+ * @param string $term Term name.
303
+ * @param bool $return_all Whether to return all categories.
304
+ * @return array Primary term object at `primary` and array of term
305
+ * objects at `all` if $return_all is true.
306
+ */
307
+ function crp_get_primary_term( $post, $term = 'category', $return_all = false ) {
308
+ $return = array(
309
+ 'primary' => '',
310
+ 'all' => array(),
311
+ );
312
+
313
+ $post = get_post( $post );
314
+ if ( empty( $post ) ) {
315
+ return $return;
316
+ }
317
+
318
+ // Yoast primary term.
319
+ if ( class_exists( 'WPSEO_Primary_Term' ) ) {
320
+ $wpseo_primary_term = new WPSEO_Primary_Term( $term, $post->ID );
321
+ $primary_term = $wpseo_primary_term->get_primary_term();
322
+ $primary_term = get_term( $wpseo_primary_term->get_primary_term() );
323
+
324
+ if ( ! is_wp_error( $primary_term ) ) {
325
+ $return['primary'] = $primary_term;
326
+ }
327
+ }
328
+
329
+ // Rank Math SEO primary term.
330
+ if ( class_exists( 'RankMath' ) ) {
331
+ $primary_term = get_term( get_post_meta( $post->ID, "rank_math_primary_{$term}", true ) );
332
+ if ( ! is_wp_error( $primary_term ) ) {
333
+ $return['primary'] = $primary_term;
334
+ }
335
+ }
336
+
337
+ // The SEO Framework primary term.
338
+ if ( function_exists( 'the_seo_framework' ) ) {
339
+ $primary_term = get_term( get_post_meta( $post->ID, "_primary_term_{$term}", true ) );
340
+ if ( ! is_wp_error( $primary_term ) ) {
341
+ $return['primary'] = $primary_term;
342
+ }
343
+ }
344
+
345
+ // SEOPress primary term.
346
+ if ( function_exists( 'seopress_init' ) ) {
347
+ $primary_term = get_term( get_post_meta( $post->ID, '_seopress_robots_primary_cat', true ) );
348
+ if ( ! is_wp_error( $primary_term ) ) {
349
+ $return['primary'] = $primary_term;
350
+ }
351
+ }
352
+
353
+ if ( empty( $return['primary'] ) || $return_all ) {
354
+ $categories = get_the_terms( $post, $term );
355
+
356
+ if ( ! empty( $categories ) ) {
357
+ if ( empty( $return['primary'] ) ) {
358
+ $return['primary'] = $categories[0];
359
+ }
360
+ $return['all'] = ( $return_all ) ? $categories : array();
361
+ }
362
+ }
363
+
364
+ /**
365
+ * Filters the primary category/term for the given post.
366
+ *
367
+ * @since 3.2.0
368
+ *
369
+ * @param array $return Primary term object at `primary` and optionally
370
+ * array of term objects at `all`.
371
+ * @param int|WP_Post $post Post ID or WP_Post object.
372
+ * @param string $term Term name.
373
+ */
374
+ return apply_filters( 'crp_get_primary_term', $return, $post, $term );
375
+ }
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: 2022-01-29 14:35+0000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza\n"
8
  "Language-Team: WebberZone\n"
@@ -23,7 +23,7 @@ msgstr ""
23
  msgid "Contextual Related Posts"
24
  msgstr ""
25
 
26
- #: includes/admin/admin.php:32 includes/admin/default-settings.php:215
27
  #: includes/deprecated.php:147
28
  msgid "Related Posts"
29
  msgstr ""
@@ -44,115 +44,6 @@ msgid ""
44
  "\"%2$s\" target=\"_blank\">WordPress.org</a>"
45
  msgstr ""
46
 
47
- #: includes/admin/blocks/related-posts/index.js:22
48
- #: includes/admin/blocks/related-posts/index.min.js:1
49
- #: includes/modules/class-crp-widget.php:29
50
- msgid "Related Posts [CRP]"
51
- msgstr ""
52
-
53
- #: includes/admin/blocks/related-posts/index.js:23
54
- #: includes/admin/blocks/related-posts/index.min.js:1
55
- msgid "Display related posts by Contextual Related Posts"
56
- msgstr ""
57
-
58
- #: includes/admin/blocks/related-posts/index.js:26
59
- #: includes/admin/blocks/related-posts/index.min.js:1
60
- msgid "related posts"
61
- msgstr ""
62
-
63
- #: includes/admin/blocks/related-posts/index.js:26
64
- #: includes/admin/blocks/related-posts/index.min.js:1
65
- msgid "contextual"
66
- msgstr ""
67
-
68
- #: includes/admin/blocks/related-posts/index.js:26
69
- #: includes/admin/blocks/related-posts/index.min.js:1
70
- msgid "posts"
71
- msgstr ""
72
-
73
- #: includes/admin/blocks/related-posts/index.js:141
74
- #: includes/admin/blocks/related-posts/index.min.js:1
75
- msgid "Show heading"
76
- msgstr ""
77
-
78
- #: includes/admin/blocks/related-posts/index.js:146
79
- #: includes/admin/blocks/related-posts/index.min.js:1
80
- #: includes/modules/class-crp-widget.php:87
81
- msgid "No. of posts"
82
- msgstr ""
83
-
84
- #: includes/admin/blocks/related-posts/index.js:157
85
- #: includes/admin/blocks/related-posts/index.min.js:1
86
- #: includes/modules/class-crp-widget.php:92
87
- msgid "Offset"
88
- msgstr ""
89
-
90
- #: includes/admin/blocks/related-posts/index.js:168
91
- #: includes/admin/blocks/related-posts/index.min.js:1
92
- msgid "Show excerpt"
93
- msgstr ""
94
-
95
- #: includes/admin/blocks/related-posts/index.js:173
96
- #: includes/admin/blocks/related-posts/index.min.js:1
97
- #: includes/admin/default-settings.php:262
98
- msgid "Show author"
99
- msgstr ""
100
-
101
- #: includes/admin/blocks/related-posts/index.js:178
102
- #: includes/admin/blocks/related-posts/index.min.js:1
103
- #: includes/admin/default-settings.php:255
104
- msgid "Show date"
105
- msgstr ""
106
-
107
- #: includes/admin/blocks/related-posts/index.js:184
108
- #: includes/admin/blocks/related-posts/index.min.js:1
109
- #: includes/modules/class-crp-widget.php:111
110
- msgid "Thumbnail options"
111
- msgstr ""
112
-
113
- #: includes/admin/blocks/related-posts/index.js:187
114
- #: includes/admin/blocks/related-posts/index.min.js:1
115
- msgid "Before title"
116
- msgstr ""
117
-
118
- #: includes/admin/blocks/related-posts/index.js:188
119
- #: includes/admin/blocks/related-posts/index.min.js:1
120
- msgid "After title"
121
- msgstr ""
122
-
123
- #: includes/admin/blocks/related-posts/index.js:189
124
- #: includes/admin/blocks/related-posts/index.min.js:1
125
- msgid "Only thumbnail"
126
- msgstr ""
127
-
128
- #: includes/admin/blocks/related-posts/index.js:190
129
- #: includes/admin/blocks/related-posts/index.min.js:1
130
- msgid "Only text"
131
- msgstr ""
132
-
133
- #: includes/admin/blocks/related-posts/index.js:195
134
- #: includes/admin/blocks/related-posts/index.min.js:1
135
- msgid "Ordering"
136
- msgstr ""
137
-
138
- #: includes/admin/blocks/related-posts/index.js:200
139
- #: includes/admin/blocks/related-posts/index.min.js:1
140
- #: includes/admin/default-settings.php:406
141
- msgid "Randomize posts"
142
- msgstr ""
143
-
144
- #: includes/admin/blocks/related-posts/index.js:205
145
- #: includes/admin/blocks/related-posts/index.min.js:1
146
- msgid "Other attributes"
147
- msgstr ""
148
-
149
- #: includes/admin/blocks/related-posts/index.js:206
150
- #: includes/admin/blocks/related-posts/index.min.js:1
151
- msgid ""
152
- "Enter other attributes in a URL-style string-query. e.g. post_types=post,"
153
- "page&link_nofollow=1&exclude_post_ids=5,6"
154
- msgstr ""
155
-
156
  #: includes/admin/default-settings.php:62
157
  msgid "Cache posts only"
158
  msgstr ""
@@ -185,7 +76,9 @@ msgstr ""
185
  #, php-format
186
  msgid ""
187
  "If you choose to disable this, please add %1$s to your template file where "
188
- "you want it displayed"
 
 
189
  msgstr ""
190
 
191
  #: includes/admin/default-settings.php:85
@@ -239,269 +132,265 @@ msgid ""
239
  msgstr ""
240
 
241
  #: includes/admin/default-settings.php:111
242
- msgid "Only from same"
243
- msgstr ""
244
-
245
- #: includes/admin/default-settings.php:112
246
- msgid ""
247
- "Limit the related posts only to the categories, tags, and/or taxonomies of "
248
- "the current post."
249
- msgstr ""
250
-
251
- #: includes/admin/default-settings.php:118
252
- msgid "Match all taxonomies"
253
- msgstr ""
254
-
255
- #: includes/admin/default-settings.php:119
256
- msgid ""
257
- "If enabled, then it will only select posts that match all the above selected "
258
- "taxonomies. This can result in no related posts being found."
259
- msgstr ""
260
-
261
- #: includes/admin/default-settings.php:125
262
- msgid "Number of common terms"
263
- msgstr ""
264
-
265
- #: includes/admin/default-settings.php:126
266
- msgid ""
267
- "Enter the minimum number of common terms that have to be matched before a "
268
- "post is considered related."
269
- msgstr ""
270
-
271
- #: includes/admin/default-settings.php:133
272
  msgid "Disable on mobile devices"
273
  msgstr ""
274
 
275
- #: includes/admin/default-settings.php:134
276
  msgid ""
277
  "Disable display of related posts on mobile devices. Might not always work "
278
  "with caching plugins."
279
  msgstr ""
280
 
281
- #: includes/admin/default-settings.php:140
282
  msgid "Disable on AMP pages"
283
  msgstr ""
284
 
285
- #: includes/admin/default-settings.php:141
286
  msgid "Disable display of related posts on AMP pages."
287
  msgstr ""
288
 
289
- #: includes/admin/default-settings.php:147
290
  msgid "Delete options on uninstall"
291
  msgstr ""
292
 
293
- #: includes/admin/default-settings.php:148
294
  msgid ""
295
  "If this is checked, all settings related to Contextual Related Posts are "
296
  "removed from the database if you choose to uninstall/delete the plugin."
297
  msgstr ""
298
 
299
- #: includes/admin/default-settings.php:154
300
  msgid "Delete FULLTEXT indices on uninstall"
301
  msgstr ""
302
 
303
- #: includes/admin/default-settings.php:155
304
  msgid ""
305
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
306
  "are removed from the database if you choose to uninstall/delete the plugin."
307
  msgstr ""
308
 
309
- #: includes/admin/default-settings.php:161
310
  msgid "Delete FULLTEXT indices on deactivate"
311
  msgstr ""
312
 
313
- #: includes/admin/default-settings.php:162
314
  msgid ""
315
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
316
  "are removed from the database if you choose to deactivate the plugin."
317
  msgstr ""
318
 
319
- #: includes/admin/default-settings.php:168
320
  msgid "Show metabox"
321
  msgstr ""
322
 
323
- #: includes/admin/default-settings.php:169
324
  msgid ""
325
  "This will add the Contextual Related Posts metabox on Edit Posts or Add New "
326
  "Posts screens. Also applies to Pages and Custom Post Types."
327
  msgstr ""
328
 
329
- #: includes/admin/default-settings.php:175
330
  msgid "Limit meta box to Admins only"
331
  msgstr ""
332
 
333
- #: includes/admin/default-settings.php:176
334
  msgid ""
335
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
336
  "default, Contributors and above will be able to see the meta box. Applies "
337
  "only if the above option is selected."
338
  msgstr ""
339
 
340
- #: includes/admin/default-settings.php:182
341
  msgid "Link to Contextual Related Posts plugin page"
342
  msgstr ""
343
 
344
- #: includes/admin/default-settings.php:183
345
  msgid ""
346
  "A no-follow link to the plugin homepage will be added as the last item of "
347
  "the related posts."
348
  msgstr ""
349
 
350
- #: includes/admin/default-settings.php:212
351
  msgid "Heading of posts"
352
  msgstr ""
353
 
354
- #: includes/admin/default-settings.php:213
355
  msgid "Displayed before the list of the posts as a master heading"
356
  msgstr ""
357
 
358
- #: includes/admin/default-settings.php:220
359
  msgid "Show when no posts are found"
360
  msgstr ""
361
 
362
- #: includes/admin/default-settings.php:226
363
  msgid "Blank output"
364
  msgstr ""
365
 
366
- #: includes/admin/default-settings.php:227
367
  msgid "Display custom text"
368
  msgstr ""
369
 
370
- #: includes/admin/default-settings.php:232
371
  msgid "Custom text"
372
  msgstr ""
373
 
374
- #: includes/admin/default-settings.php:233
375
  msgid ""
376
  "Enter the custom text that will be displayed if the second option is "
377
  "selected above."
378
  msgstr ""
379
 
380
- #: includes/admin/default-settings.php:235 includes/deprecated.php:149
381
  msgid "No related posts found"
382
  msgstr ""
383
 
384
- #: includes/admin/default-settings.php:239
385
- #: includes/admin/default-settings.php:694
386
  msgid "Show post excerpt"
387
  msgstr ""
388
 
389
- #: includes/admin/default-settings.php:240
390
  msgid ""
391
  "If the post does not have an excerpt, the plugin will automatically create "
392
  "one containing the number of words specified in the next option."
393
  msgstr ""
394
 
395
- #: includes/admin/default-settings.php:246
396
  msgid "Length of excerpt (in words)"
397
  msgstr ""
398
 
399
- #: includes/admin/default-settings.php:256
 
 
 
 
 
400
  msgid ""
401
  "Displays the date of the post. Uses the same date format set in General "
402
  "Options."
403
  msgstr ""
404
 
405
- #: includes/admin/default-settings.php:269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  msgid "Limit post title length (in characters)"
407
  msgstr ""
408
 
409
- #: includes/admin/default-settings.php:270
410
  msgid ""
411
  "Any title longer than the number of characters set above will be cut and "
412
  "appended with an ellipsis (&hellip;)"
413
  msgstr ""
414
 
415
- #: includes/admin/default-settings.php:278
416
  msgid "Open links in new window"
417
  msgstr ""
418
 
419
- #: includes/admin/default-settings.php:285
420
  msgid "Add nofollow to links"
421
  msgstr ""
422
 
423
- #: includes/admin/default-settings.php:292
424
  msgid "Exclusion settings"
425
  msgstr ""
426
 
427
- #: includes/admin/default-settings.php:298
428
  msgid "Exclude display on these posts"
429
  msgstr ""
430
 
431
- #: includes/admin/default-settings.php:299
432
  msgid ""
433
  "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500"
434
  msgstr ""
435
 
436
- #: includes/admin/default-settings.php:305
437
  msgid "Exclude display on these post types"
438
  msgstr ""
439
 
440
- #: includes/admin/default-settings.php:306
441
  msgid ""
442
  "The related posts will not display on any of the above selected post types."
443
  msgstr ""
444
 
445
- #: includes/admin/default-settings.php:312
446
- msgid "Exclude on Categories"
447
  msgstr ""
448
 
449
- #: includes/admin/default-settings.php:313
450
- #: includes/admin/default-settings.php:459
451
  msgid ""
452
- "Comma separated list of category slugs. The field above has an autocomplete "
453
- "so simply start typing in the starting letters and it will prompt you with "
454
- "options. Does not support custom taxonomies."
455
  msgstr ""
456
 
457
- #: includes/admin/default-settings.php:324
458
  msgid "HTML to display"
459
  msgstr ""
460
 
461
- #: includes/admin/default-settings.php:330
462
  msgid "Before the list of posts"
463
  msgstr ""
464
 
465
- #: includes/admin/default-settings.php:337
466
  msgid "After the list of posts"
467
  msgstr ""
468
 
469
- #: includes/admin/default-settings.php:344
470
  msgid "Before each list item"
471
  msgstr ""
472
 
473
- #: includes/admin/default-settings.php:351
474
  msgid "After each list item"
475
  msgstr ""
476
 
477
- #: includes/admin/default-settings.php:381
478
- #: includes/admin/default-settings.php:685
479
  msgid "Number of posts to display"
480
  msgstr ""
481
 
482
- #: includes/admin/default-settings.php:382
483
  msgid ""
484
  "Maximum number of posts that will be displayed in the list. This option is "
485
  "used if you do not specify the number of posts in the widget or shortcodes"
486
  msgstr ""
487
 
488
- #: includes/admin/default-settings.php:390
489
  msgid "Related posts should be newer than"
490
  msgstr ""
491
 
492
- #: includes/admin/default-settings.php:391
493
  msgid ""
494
  "This sets the cut-off period for which posts will be displayed. e.g. setting "
495
  "it to 365 will show related posts from the last year only. Set to 0 to "
496
  "disable limiting posts by date."
497
  msgstr ""
498
 
499
- #: includes/admin/default-settings.php:398
500
- #: includes/modules/class-crp-widget.php:129
 
501
  msgid "Order posts"
502
  msgstr ""
503
 
504
- #: includes/admin/default-settings.php:407
 
 
 
 
 
505
  msgid ""
506
  "This shuffles the selected related posts. If you select to order by date in "
507
  "the previous option, then the related posts will first be sorted by date and "
@@ -509,79 +398,120 @@ msgid ""
509
  "enabled."
510
  msgstr ""
511
 
512
- #: includes/admin/default-settings.php:413
513
  msgid "Related posts based on title and content"
514
  msgstr ""
515
 
516
- #: includes/admin/default-settings.php:414
517
  msgid ""
518
  "If unchecked, only posts titles are used. Enable the cache if enabling this "
519
  "option for better performance. Each site is different, so toggle this option "
520
  "to see which setting gives you better quality related posts."
521
  msgstr ""
522
 
523
- #: includes/admin/default-settings.php:420
524
  msgid "Limit content to be compared"
525
  msgstr ""
526
 
527
- #: includes/admin/default-settings.php:422
528
  #, php-format
529
  msgid ""
530
  "This sets the maximum words of the content that will be matched. Set to 0 "
531
  "for no limit. Max value: %1$s. Only applies if you activate the above option."
532
  msgstr ""
533
 
534
- #: includes/admin/default-settings.php:430
535
- #: includes/modules/class-crp-widget.php:153
536
  msgid "Post types to include"
537
  msgstr ""
538
 
539
- #: includes/admin/default-settings.php:431
540
  msgid ""
541
  "At least one option should be selected above. Select which post types you "
542
  "want to include in the list of posts. This field can be overridden using a "
543
  "comma separated list of post types when using the manual display."
544
  msgstr ""
545
 
546
- #: includes/admin/default-settings.php:437
547
  msgid "Limit to same post type"
548
  msgstr ""
549
 
550
- #: includes/admin/default-settings.php:438
551
  msgid ""
552
  "If checked, the related posts will only be selected from the same post type "
553
  "of the current post."
554
  msgstr ""
555
 
556
- #: includes/admin/default-settings.php:444
557
  msgid "Limit to same author"
558
  msgstr ""
559
 
560
- #: includes/admin/default-settings.php:445
561
  msgid ""
562
  "If checked, the related posts will only be selected from the same author of "
563
  "the current post."
564
  msgstr ""
565
 
566
- #: includes/admin/default-settings.php:451
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  msgid "Post/page IDs to exclude"
568
  msgstr ""
569
 
570
- #: includes/admin/default-settings.php:452
571
  msgid ""
572
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
573
  "188,320,500"
574
  msgstr ""
575
 
576
- #: includes/admin/default-settings.php:458
577
- msgid "Exclude Categories"
578
  msgstr ""
579
 
580
- #: includes/admin/default-settings.php:470
581
- msgid "Exclude category IDs"
582
  msgstr ""
583
 
584
- #: includes/admin/default-settings.php:471
585
  msgid ""
586
  "This is a readonly field that is automatically populated based on the above "
587
  "input when the settings are saved. These might differ from the IDs visible "
@@ -589,59 +519,59 @@ msgid ""
589
  "the term_taxonomy_id which is unique to this taxonomy."
590
  msgstr ""
591
 
592
- #: includes/admin/default-settings.php:478
593
  msgid "Disable contextual matching"
594
  msgstr ""
595
 
596
- #: includes/admin/default-settings.php:479
597
  msgid ""
598
  "Selecting this option will turn off contextual matching. This is only useful "
599
- "if you activate the option: \"Only from same\" from the General tab. "
600
- "Otherwise, you will end up with the same set of related posts on all pages "
601
- "with no relevance."
602
  msgstr ""
603
 
604
- #: includes/admin/default-settings.php:485
605
  msgid "Disable contextual matching ONLY on attachments and custom post types"
606
  msgstr ""
607
 
608
- #: includes/admin/default-settings.php:486
609
  msgid ""
610
  "Applies only if the previous option is checked. Selecting this option will "
611
  "retain contextual matching for posts and pages but disable this on any "
612
  "custom post types."
613
  msgstr ""
614
 
615
- #: includes/admin/default-settings.php:515
616
- #: includes/admin/default-settings.php:701
 
617
  msgid "Location of the post thumbnail"
618
  msgstr ""
619
 
620
- #: includes/admin/default-settings.php:520
621
- #: includes/admin/default-settings.php:706
622
  msgid "Display thumbnails inline with posts, before title"
623
  msgstr ""
624
 
625
- #: includes/admin/default-settings.php:521
626
- #: includes/admin/default-settings.php:707
627
  msgid "Display thumbnails inline with posts, after title"
628
  msgstr ""
629
 
630
- #: includes/admin/default-settings.php:522
631
- #: includes/admin/default-settings.php:708
632
  msgid "Display only thumbnails, no text"
633
  msgstr ""
634
 
635
- #: includes/admin/default-settings.php:523
636
- #: includes/admin/default-settings.php:709
637
  msgid "Do not display thumbnails, only text"
638
  msgstr ""
639
 
640
- #: includes/admin/default-settings.php:528
641
  msgid "Thumbnail size"
642
  msgstr ""
643
 
644
- #: includes/admin/default-settings.php:529
645
  msgid ""
646
  "You can choose from existing image sizes above or create a custom size. If "
647
  "you have chosen Custom size above, then enter the width, height and crop "
@@ -649,125 +579,125 @@ msgid ""
649
  "width and/or height below, existing images will not be automatically resized."
650
  msgstr ""
651
 
652
- #: includes/admin/default-settings.php:531
653
  #, php-format
654
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
655
  msgstr ""
656
 
657
- #: includes/admin/default-settings.php:541
658
- #: includes/admin/default-settings.php:714
659
- #: includes/modules/class-crp-widget.php:126
660
  msgid "Thumbnail width"
661
  msgstr ""
662
 
663
- #: includes/admin/default-settings.php:550
664
- #: includes/admin/default-settings.php:723
665
- #: includes/modules/class-crp-widget.php:121
666
  msgid "Thumbnail height"
667
  msgstr ""
668
 
669
- #: includes/admin/default-settings.php:559
670
  msgid "Hard crop thumbnails"
671
  msgstr ""
672
 
673
- #: includes/admin/default-settings.php:560
674
  msgid ""
675
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
676
  "above vs. maintaining proportions."
677
  msgstr ""
678
 
679
- #: includes/admin/default-settings.php:566
680
  msgid "Generate thumbnail sizes"
681
  msgstr ""
682
 
683
- #: includes/admin/default-settings.php:567
684
  msgid ""
685
  "If you select this option and Custom size is selected above, the plugin will "
686
  "register the image size with WordPress to create new thumbnails. Does not "
687
  "update old images as explained above."
688
  msgstr ""
689
 
690
- #: includes/admin/default-settings.php:573
691
  msgid "Thumbnail size attributes"
692
  msgstr ""
693
 
694
- #: includes/admin/default-settings.php:579
695
  #, php-format
696
  msgid "Use CSS to set the width and height: e.g. %s"
697
  msgstr ""
698
 
699
- #: includes/admin/default-settings.php:581
700
  #, php-format
701
  msgid "Use HTML attributes to set the width and height: e.g. %s"
702
  msgstr ""
703
 
704
- #: includes/admin/default-settings.php:582
705
  msgid ""
706
  "No width or height set. You will need to use external styles to force any "
707
  "width or height of your choice."
708
  msgstr ""
709
 
710
- #: includes/admin/default-settings.php:587
711
  msgid "Thumbnail meta field name"
712
  msgstr ""
713
 
714
- #: includes/admin/default-settings.php:588
715
  msgid ""
716
  "The value of this field should contain the URL of the image and can be set "
717
  "in the metabox in the Edit Post screen"
718
  msgstr ""
719
 
720
- #: includes/admin/default-settings.php:594
721
  msgid "Get first image"
722
  msgstr ""
723
 
724
- #: includes/admin/default-settings.php:595
725
  msgid ""
726
  "The plugin will fetch the first image in the post content if this is "
727
  "enabled. This can slow down the loading of your page if the first image in "
728
  "the followed posts is large in file-size."
729
  msgstr ""
730
 
731
- #: includes/admin/default-settings.php:601
732
  msgid "Use default thumbnail?"
733
  msgstr ""
734
 
735
- #: includes/admin/default-settings.php:602
736
  msgid ""
737
  "If checked, when no thumbnail is found, show a default one from the URL "
738
  "below. If not checked and no thumbnail is found, no image will be shown."
739
  msgstr ""
740
 
741
- #: includes/admin/default-settings.php:608 includes/admin/settings-page.php:747
742
  msgid "Default thumbnail"
743
  msgstr ""
744
 
745
- #: includes/admin/default-settings.php:609
746
  msgid ""
747
  "Enter the full URL of the image that you wish to display if no thumbnail is "
748
  "found. This image will be displayed below."
749
  msgstr ""
750
 
751
- #: includes/admin/default-settings.php:639
752
  msgid "Related Posts style"
753
  msgstr ""
754
 
755
- #: includes/admin/default-settings.php:647
756
  msgid "Custom CSS"
757
  msgstr ""
758
 
759
- #: includes/admin/default-settings.php:649
760
  #, php-format
761
  msgid ""
762
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
763
  "CSS classes to style."
764
  msgstr ""
765
 
766
- #: includes/admin/default-settings.php:679
767
  msgid "About this tab"
768
  msgstr ""
769
 
770
- #: includes/admin/default-settings.php:680
771
  msgid ""
772
  "Below options override the related posts settings for your blog feed. These "
773
  "only apply if you have selected to add related posts to Feeds in the General "
@@ -775,68 +705,71 @@ msgid ""
775
  "way to style the related posts in the feed."
776
  msgstr ""
777
 
778
- #: includes/admin/default-settings.php:800
779
  msgid "No styles"
780
  msgstr ""
781
 
782
- #: includes/admin/default-settings.php:801
783
  msgid "Select this option if you plan to add your own styles"
784
  msgstr ""
785
 
786
- #: includes/admin/default-settings.php:805
787
  msgid "Text only"
788
  msgstr ""
789
 
790
- #: includes/admin/default-settings.php:806
791
  msgid "Disable thumbnails and no longer include the default style sheet"
792
  msgstr ""
793
 
794
- #: includes/admin/default-settings.php:810
795
  msgid "Rounded thumbnails"
796
  msgstr ""
797
 
798
- #: includes/admin/default-settings.php:811
799
  msgid ""
800
  "Enabling this option will turn on the thumbnails. It will also turn off the "
801
  "display of the author, excerpt and date if already enabled. Disabling this "
802
  "option will not revert any settings."
803
  msgstr ""
804
 
805
- #: includes/admin/default-settings.php:815
806
  msgid "Masonry"
807
  msgstr ""
808
 
809
- #: includes/admin/default-settings.php:816
810
  msgid "Enables a masonry style layout similar to one made famous by Pinterest."
811
  msgstr ""
812
 
813
- #: includes/admin/default-settings.php:820
814
  msgid "Grid"
815
  msgstr ""
816
 
817
- #: includes/admin/default-settings.php:821
818
  msgid "Uses CSS Grid for display. Might not work on older browsers."
819
  msgstr ""
820
 
821
- #: includes/admin/default-settings.php:825
822
  msgid "Rounded thumbnails with CSS grid"
823
  msgstr ""
824
 
825
- #: includes/admin/default-settings.php:826
826
  msgid ""
827
  "Uses CSS grid. It will also turn off the display of the author, excerpt and "
828
  "date if already enabled. Disabling this option will not revert any settings."
829
  msgstr ""
830
 
831
- #: includes/admin/default-settings.php:849
 
832
  msgid "By relevance"
833
  msgstr ""
834
 
835
- #: includes/admin/default-settings.php:850
 
836
  msgid "Randomly"
837
  msgstr ""
838
 
839
- #: includes/admin/default-settings.php:851
 
840
  msgid "By date"
841
  msgstr ""
842
 
@@ -910,31 +843,31 @@ msgstr ""
910
  msgid "Contribute"
911
  msgstr ""
912
 
913
- #: includes/admin/modules/metabox.php:99
914
  msgid "Disable Related Posts display:"
915
  msgstr ""
916
 
917
- #: includes/admin/modules/metabox.php:102
918
  msgid ""
919
  "If this is checked, then Contextual Related Posts will not automatically "
920
  "insert the related posts at the end of post content."
921
  msgstr ""
922
 
923
- #: includes/admin/modules/metabox.php:106
924
  msgid "Exclude this post from the related posts list:"
925
  msgstr ""
926
 
927
- #: includes/admin/modules/metabox.php:109
928
  msgid ""
929
  "If this is checked, then this post will be excluded from the popular posts "
930
  "list."
931
  msgstr ""
932
 
933
- #: includes/admin/modules/metabox.php:113
934
  msgid "Keyword:"
935
  msgstr ""
936
 
937
- #: includes/admin/modules/metabox.php:115
938
  msgid ""
939
  "Enter either a word or a phrase that will be used to find related posts. If "
940
  "entered, the plugin will continue to search the `post_title` and "
@@ -942,56 +875,70 @@ msgid ""
942
  "title and content of this post."
943
  msgstr ""
944
 
945
- #: includes/admin/modules/metabox.php:119
946
  msgid "Exclude terms:"
947
  msgstr ""
948
 
949
- #: includes/admin/modules/metabox.php:121
950
  msgid ""
951
  "Enter a comma-separated list of terms. If a related post's title or content "
952
  "contains any of these terms then it will be excluded from the results."
953
  msgstr ""
954
 
955
- #: includes/admin/modules/metabox.php:125
956
- #: includes/admin/modules/metabox.php:133
957
  msgid "Manual related posts:"
958
  msgstr ""
959
 
960
- #: includes/admin/modules/metabox.php:127
961
  msgid ""
962
  "Comma separated list of post, page or custom post type IDs. e.g. "
963
  "188,320,500. These will be given preference over the related posts generated "
964
  "by the plugin."
965
  msgstr ""
966
 
967
- #: includes/admin/modules/metabox.php:128
968
  msgid ""
969
  "Once you enter the list above and save this page, the plugin will display "
970
  "the titles of the posts below for your reference. Only IDs corresponding to "
971
  "published posts or custom post types will be retained."
972
  msgstr ""
973
 
974
- #: includes/admin/modules/metabox.php:144
 
975
  #, php-format
976
  msgid "This post type is: %s"
977
  msgstr ""
978
 
979
- #: includes/admin/modules/metabox.php:155
 
 
 
 
 
 
 
 
 
 
 
 
 
980
  msgid "Location of thumbnail"
981
  msgstr ""
982
 
983
- #: includes/admin/modules/metabox.php:157
984
  msgid ""
985
  "Enter the full URL to the image (JPG, PNG or GIF) you'd like to use. This "
986
  "image will be used for the post. It will be resized to the thumbnail size "
987
  "set under Settings &raquo; Related Posts &raquo; Output Options"
988
  msgstr ""
989
 
990
- #: includes/admin/modules/metabox.php:158
991
  msgid "The URL above is saved in the meta field:"
992
  msgstr ""
993
 
994
- #: includes/admin/modules/metabox.php:163
995
  msgid ""
996
  "You have Top 10 WordPress Plugin installed. If you are trying to modify the "
997
  "thumbnail, then you'll need to make the same change in the Top 10 meta box "
@@ -1024,8 +971,9 @@ msgstr ""
1024
 
1025
  #: includes/admin/modules/tools.php:75
1026
  msgid ""
1027
- "Clear the Contextual Related Posts cache. This will also be cleared "
1028
- "automatically when you save the settings page."
 
1029
  msgstr ""
1030
 
1031
  #: includes/admin/modules/tools.php:78 includes/admin/modules/tools.php:80
@@ -1167,19 +1115,23 @@ msgstr ""
1167
  msgid "Modified from default setting"
1168
  msgstr ""
1169
 
1170
- #: includes/admin/settings-page.php:694
 
 
 
 
1171
  msgctxt "tag delimiter"
1172
  msgid ","
1173
  msgstr ""
1174
 
1175
- #: includes/admin/settings-page.php:769
1176
  msgid ""
1177
  "This option cannot be changed because of the selected related posts style. "
1178
  "To modify this option, you will need to select No styles or Text only in the "
1179
  "Styles tab"
1180
  msgstr ""
1181
 
1182
- #: includes/admin/settings-page.php:773
1183
  msgid ""
1184
  "This option cannot be changed because of the selected related posts style. "
1185
  "To modify this option, you will need to select No styles in the Styles tab"
@@ -1233,7 +1185,111 @@ msgstr ""
1233
  msgid "Follow me"
1234
  msgstr ""
1235
 
1236
- #: includes/main-query.php:190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1237
  #, php-format
1238
  msgid ""
1239
  "Powered by <a href=\"%s\" rel=\"nofollow\" style=\"float:none\">Contextual "
@@ -1252,10 +1308,6 @@ msgstr ""
1252
  msgid "Post ID."
1253
  msgstr ""
1254
 
1255
- #: includes/modules/class-crp-rest-api.php:165
1256
- msgid "Number of posts"
1257
- msgstr ""
1258
-
1259
  #: includes/modules/class-crp-rest-api.php:170
1260
  msgid "Post types (comma separated)"
1261
  msgstr ""
@@ -1276,51 +1328,63 @@ msgstr ""
1276
  msgid "Taxonomy IDs from which posts are excluded (comma separated)"
1277
  msgstr ""
1278
 
 
 
 
 
1279
  #: includes/modules/class-crp-widget.php:31
1280
  msgid "Display Related Posts"
1281
  msgstr ""
1282
 
1283
- #: includes/modules/class-crp-widget.php:82
1284
  msgid "Title"
1285
  msgstr ""
1286
 
1287
- #: includes/modules/class-crp-widget.php:97
 
 
 
 
1288
  msgid " Show excerpt?"
1289
  msgstr ""
1290
 
1291
- #: includes/modules/class-crp-widget.php:102
1292
  msgid " Show author?"
1293
  msgstr ""
1294
 
1295
- #: includes/modules/class-crp-widget.php:107
1296
  msgid " Show date?"
1297
  msgstr ""
1298
 
1299
- #: includes/modules/class-crp-widget.php:113
 
 
 
 
1300
  msgid "Thumbnails inline, before title"
1301
  msgstr ""
1302
 
1303
- #: includes/modules/class-crp-widget.php:114
1304
  msgid "Thumbnails inline, after title"
1305
  msgstr ""
1306
 
1307
- #: includes/modules/class-crp-widget.php:115
1308
  msgid "Only thumbnails, no text"
1309
  msgstr ""
1310
 
1311
- #: includes/modules/class-crp-widget.php:116
1312
  msgid "No thumbnails, only text."
1313
  msgstr ""
1314
 
1315
- #: includes/modules/class-crp-widget.php:143
1316
  msgid " Randomize posts"
1317
  msgstr ""
1318
 
1319
- #: includes/modules/class-crp-widget.php:148
1320
- msgid "Only from categories"
1321
  msgstr ""
1322
 
1323
- #: includes/output-generator.php:235
1324
  msgid " by "
1325
  msgstr ""
1326
 
2
  msgstr ""
3
  "Project-Id-Version: Contextual Related Posts\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2022-04-21 15:12+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: Ajay D'Souza\n"
8
  "Language-Team: WebberZone\n"
23
  msgid "Contextual Related Posts"
24
  msgstr ""
25
 
26
+ #: includes/admin/admin.php:32 includes/admin/default-settings.php:193
27
  #: includes/deprecated.php:147
28
  msgid "Related Posts"
29
  msgstr ""
44
  "\"%2$s\" target=\"_blank\">WordPress.org</a>"
45
  msgstr ""
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  #: includes/admin/default-settings.php:62
48
  msgid "Cache posts only"
49
  msgstr ""
76
  #, php-format
77
  msgid ""
78
  "If you choose to disable this, please add %1$s to your template file where "
79
+ "you want it displayed. On the home page and archives, the related posts are "
80
+ "added for each post. Caching is highly recommended to avoid performance "
81
+ "issues."
82
  msgstr ""
83
 
84
  #: includes/admin/default-settings.php:85
132
  msgstr ""
133
 
134
  #: includes/admin/default-settings.php:111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  msgid "Disable on mobile devices"
136
  msgstr ""
137
 
138
+ #: includes/admin/default-settings.php:112
139
  msgid ""
140
  "Disable display of related posts on mobile devices. Might not always work "
141
  "with caching plugins."
142
  msgstr ""
143
 
144
+ #: includes/admin/default-settings.php:118
145
  msgid "Disable on AMP pages"
146
  msgstr ""
147
 
148
+ #: includes/admin/default-settings.php:119
149
  msgid "Disable display of related posts on AMP pages."
150
  msgstr ""
151
 
152
+ #: includes/admin/default-settings.php:125
153
  msgid "Delete options on uninstall"
154
  msgstr ""
155
 
156
+ #: includes/admin/default-settings.php:126
157
  msgid ""
158
  "If this is checked, all settings related to Contextual Related Posts are "
159
  "removed from the database if you choose to uninstall/delete the plugin."
160
  msgstr ""
161
 
162
+ #: includes/admin/default-settings.php:132
163
  msgid "Delete FULLTEXT indices on uninstall"
164
  msgstr ""
165
 
166
+ #: includes/admin/default-settings.php:133
167
  msgid ""
168
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
169
  "are removed from the database if you choose to uninstall/delete the plugin."
170
  msgstr ""
171
 
172
+ #: includes/admin/default-settings.php:139
173
  msgid "Delete FULLTEXT indices on deactivate"
174
  msgstr ""
175
 
176
+ #: includes/admin/default-settings.php:140
177
  msgid ""
178
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
179
  "are removed from the database if you choose to deactivate the plugin."
180
  msgstr ""
181
 
182
+ #: includes/admin/default-settings.php:146
183
  msgid "Show metabox"
184
  msgstr ""
185
 
186
+ #: includes/admin/default-settings.php:147
187
  msgid ""
188
  "This will add the Contextual Related Posts metabox on Edit Posts or Add New "
189
  "Posts screens. Also applies to Pages and Custom Post Types."
190
  msgstr ""
191
 
192
+ #: includes/admin/default-settings.php:153
193
  msgid "Limit meta box to Admins only"
194
  msgstr ""
195
 
196
+ #: includes/admin/default-settings.php:154
197
  msgid ""
198
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
199
  "default, Contributors and above will be able to see the meta box. Applies "
200
  "only if the above option is selected."
201
  msgstr ""
202
 
203
+ #: includes/admin/default-settings.php:160
204
  msgid "Link to Contextual Related Posts plugin page"
205
  msgstr ""
206
 
207
+ #: includes/admin/default-settings.php:161
208
  msgid ""
209
  "A no-follow link to the plugin homepage will be added as the last item of "
210
  "the related posts."
211
  msgstr ""
212
 
213
+ #: includes/admin/default-settings.php:190
214
  msgid "Heading of posts"
215
  msgstr ""
216
 
217
+ #: includes/admin/default-settings.php:191
218
  msgid "Displayed before the list of the posts as a master heading"
219
  msgstr ""
220
 
221
+ #: includes/admin/default-settings.php:198
222
  msgid "Show when no posts are found"
223
  msgstr ""
224
 
225
+ #: includes/admin/default-settings.php:204
226
  msgid "Blank output"
227
  msgstr ""
228
 
229
+ #: includes/admin/default-settings.php:205
230
  msgid "Display custom text"
231
  msgstr ""
232
 
233
+ #: includes/admin/default-settings.php:210
234
  msgid "Custom text"
235
  msgstr ""
236
 
237
+ #: includes/admin/default-settings.php:211
238
  msgid ""
239
  "Enter the custom text that will be displayed if the second option is "
240
  "selected above."
241
  msgstr ""
242
 
243
+ #: includes/admin/default-settings.php:213 includes/deprecated.php:149
244
  msgid "No related posts found"
245
  msgstr ""
246
 
247
+ #: includes/admin/default-settings.php:217
248
+ #: includes/admin/default-settings.php:702
249
  msgid "Show post excerpt"
250
  msgstr ""
251
 
252
+ #: includes/admin/default-settings.php:218
253
  msgid ""
254
  "If the post does not have an excerpt, the plugin will automatically create "
255
  "one containing the number of words specified in the next option."
256
  msgstr ""
257
 
258
+ #: includes/admin/default-settings.php:224
259
  msgid "Length of excerpt (in words)"
260
  msgstr ""
261
 
262
+ #: includes/admin/default-settings.php:233
263
+ #: includes/blocks/related-posts/src/edit.js:182
264
+ msgid "Show date"
265
+ msgstr ""
266
+
267
+ #: includes/admin/default-settings.php:234
268
  msgid ""
269
  "Displays the date of the post. Uses the same date format set in General "
270
  "Options."
271
  msgstr ""
272
 
273
+ #: includes/admin/default-settings.php:240
274
+ #: includes/blocks/related-posts/src/edit.js:165
275
+ msgid "Show author"
276
+ msgstr ""
277
+
278
+ #: includes/admin/default-settings.php:247
279
+ msgid "Show primary category/term"
280
+ msgstr ""
281
+
282
+ #: includes/admin/default-settings.php:248
283
+ msgid ""
284
+ "This will display the primary category/term. This is usually set via your "
285
+ "SEO plugin and will default to the first category/term returned by WordPress"
286
+ msgstr ""
287
+
288
+ #: includes/admin/default-settings.php:254
289
  msgid "Limit post title length (in characters)"
290
  msgstr ""
291
 
292
+ #: includes/admin/default-settings.php:255
293
  msgid ""
294
  "Any title longer than the number of characters set above will be cut and "
295
  "appended with an ellipsis (&hellip;)"
296
  msgstr ""
297
 
298
+ #: includes/admin/default-settings.php:263
299
  msgid "Open links in new window"
300
  msgstr ""
301
 
302
+ #: includes/admin/default-settings.php:270
303
  msgid "Add nofollow to links"
304
  msgstr ""
305
 
306
+ #: includes/admin/default-settings.php:277
307
  msgid "Exclusion settings"
308
  msgstr ""
309
 
310
+ #: includes/admin/default-settings.php:283
311
  msgid "Exclude display on these posts"
312
  msgstr ""
313
 
314
+ #: includes/admin/default-settings.php:284
315
  msgid ""
316
  "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500"
317
  msgstr ""
318
 
319
+ #: includes/admin/default-settings.php:290
320
  msgid "Exclude display on these post types"
321
  msgstr ""
322
 
323
+ #: includes/admin/default-settings.php:291
324
  msgid ""
325
  "The related posts will not display on any of the above selected post types."
326
  msgstr ""
327
 
328
+ #: includes/admin/default-settings.php:297
329
+ msgid "Exclude on Terms"
330
  msgstr ""
331
 
332
+ #: includes/admin/default-settings.php:298
333
+ #: includes/admin/default-settings.php:470
334
  msgid ""
335
+ "The field above has an autocomplete so simply start typing in the starting "
336
+ "letters and it will prompt you with options. This field requires a specific "
337
+ "format as displayed by the autocomplete."
338
  msgstr ""
339
 
340
+ #: includes/admin/default-settings.php:306
341
  msgid "HTML to display"
342
  msgstr ""
343
 
344
+ #: includes/admin/default-settings.php:312
345
  msgid "Before the list of posts"
346
  msgstr ""
347
 
348
+ #: includes/admin/default-settings.php:319
349
  msgid "After the list of posts"
350
  msgstr ""
351
 
352
+ #: includes/admin/default-settings.php:326
353
  msgid "Before each list item"
354
  msgstr ""
355
 
356
+ #: includes/admin/default-settings.php:333
357
  msgid "After each list item"
358
  msgstr ""
359
 
360
+ #: includes/admin/default-settings.php:363
361
+ #: includes/admin/default-settings.php:693
362
  msgid "Number of posts to display"
363
  msgstr ""
364
 
365
+ #: includes/admin/default-settings.php:364
366
  msgid ""
367
  "Maximum number of posts that will be displayed in the list. This option is "
368
  "used if you do not specify the number of posts in the widget or shortcodes"
369
  msgstr ""
370
 
371
+ #: includes/admin/default-settings.php:372
372
  msgid "Related posts should be newer than"
373
  msgstr ""
374
 
375
+ #: includes/admin/default-settings.php:373
376
  msgid ""
377
  "This sets the cut-off period for which posts will be displayed. e.g. setting "
378
  "it to 365 will show related posts from the last year only. Set to 0 to "
379
  "disable limiting posts by date."
380
  msgstr ""
381
 
382
+ #: includes/admin/default-settings.php:380
383
+ #: includes/blocks/related-posts/src/edit.js:230
384
+ #: includes/modules/class-crp-widget.php:128
385
  msgid "Order posts"
386
  msgstr ""
387
 
388
+ #: includes/admin/default-settings.php:388
389
+ #: includes/blocks/related-posts/src/edit.js:257
390
+ msgid "Randomize posts"
391
+ msgstr ""
392
+
393
+ #: includes/admin/default-settings.php:389
394
  msgid ""
395
  "This shuffles the selected related posts. If you select to order by date in "
396
  "the previous option, then the related posts will first be sorted by date and "
398
  "enabled."
399
  msgstr ""
400
 
401
+ #: includes/admin/default-settings.php:395
402
  msgid "Related posts based on title and content"
403
  msgstr ""
404
 
405
+ #: includes/admin/default-settings.php:396
406
  msgid ""
407
  "If unchecked, only posts titles are used. Enable the cache if enabling this "
408
  "option for better performance. Each site is different, so toggle this option "
409
  "to see which setting gives you better quality related posts."
410
  msgstr ""
411
 
412
+ #: includes/admin/default-settings.php:402
413
  msgid "Limit content to be compared"
414
  msgstr ""
415
 
416
+ #: includes/admin/default-settings.php:404
417
  #, php-format
418
  msgid ""
419
  "This sets the maximum words of the content that will be matched. Set to 0 "
420
  "for no limit. Max value: %1$s. Only applies if you activate the above option."
421
  msgstr ""
422
 
423
+ #: includes/admin/default-settings.php:412
424
+ #: includes/modules/class-crp-widget.php:151
425
  msgid "Post types to include"
426
  msgstr ""
427
 
428
+ #: includes/admin/default-settings.php:413
429
  msgid ""
430
  "At least one option should be selected above. Select which post types you "
431
  "want to include in the list of posts. This field can be overridden using a "
432
  "comma separated list of post types when using the manual display."
433
  msgstr ""
434
 
435
+ #: includes/admin/default-settings.php:419
436
  msgid "Limit to same post type"
437
  msgstr ""
438
 
439
+ #: includes/admin/default-settings.php:420
440
  msgid ""
441
  "If checked, the related posts will only be selected from the same post type "
442
  "of the current post."
443
  msgstr ""
444
 
445
+ #: includes/admin/default-settings.php:426
446
  msgid "Limit to same author"
447
  msgstr ""
448
 
449
+ #: includes/admin/default-settings.php:427
450
  msgid ""
451
  "If checked, the related posts will only be selected from the same author of "
452
  "the current post."
453
  msgstr ""
454
 
455
+ #: includes/admin/default-settings.php:433
456
+ msgid "Limit to same primary term"
457
+ msgstr ""
458
+
459
+ #: includes/admin/default-settings.php:434
460
+ msgid ""
461
+ "If enabled, then it will only select posts from the primary category/term. "
462
+ "This is usually set via your SEO plugin and will default to the first "
463
+ "category/term returned by WordPress"
464
+ msgstr ""
465
+
466
+ #: includes/admin/default-settings.php:440
467
+ msgid "Only from same"
468
+ msgstr ""
469
+
470
+ #: includes/admin/default-settings.php:441
471
+ msgid ""
472
+ "Limit the related posts only to the categories, tags, and/or taxonomies of "
473
+ "the current post."
474
+ msgstr ""
475
+
476
+ #: includes/admin/default-settings.php:447
477
+ msgid "Match all taxonomies"
478
+ msgstr ""
479
+
480
+ #: includes/admin/default-settings.php:448
481
+ msgid ""
482
+ "If enabled, then it will only select posts that match all the above selected "
483
+ "taxonomies. This can result in no related posts being found."
484
+ msgstr ""
485
+
486
+ #: includes/admin/default-settings.php:454
487
+ msgid "Number of common terms"
488
+ msgstr ""
489
+
490
+ #: includes/admin/default-settings.php:455
491
+ msgid ""
492
+ "Enter the minimum number of common terms that have to be matched before a "
493
+ "post is considered related."
494
+ msgstr ""
495
+
496
+ #: includes/admin/default-settings.php:462
497
  msgid "Post/page IDs to exclude"
498
  msgstr ""
499
 
500
+ #: includes/admin/default-settings.php:463
501
  msgid ""
502
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
503
  "188,320,500"
504
  msgstr ""
505
 
506
+ #: includes/admin/default-settings.php:469
507
+ msgid "Exclude Terms"
508
  msgstr ""
509
 
510
+ #: includes/admin/default-settings.php:478
511
+ msgid "Exclude Term Taxonomy IDs"
512
  msgstr ""
513
 
514
+ #: includes/admin/default-settings.php:479
515
  msgid ""
516
  "This is a readonly field that is automatically populated based on the above "
517
  "input when the settings are saved. These might differ from the IDs visible "
519
  "the term_taxonomy_id which is unique to this taxonomy."
520
  msgstr ""
521
 
522
+ #: includes/admin/default-settings.php:486
523
  msgid "Disable contextual matching"
524
  msgstr ""
525
 
526
+ #: includes/admin/default-settings.php:487
527
  msgid ""
528
  "Selecting this option will turn off contextual matching. This is only useful "
529
+ "if you activate the option: \"Only from same\" above. Otherwise, you will "
530
+ "end up with the same set of related posts across your site with no relevance."
 
531
  msgstr ""
532
 
533
+ #: includes/admin/default-settings.php:493
534
  msgid "Disable contextual matching ONLY on attachments and custom post types"
535
  msgstr ""
536
 
537
+ #: includes/admin/default-settings.php:494
538
  msgid ""
539
  "Applies only if the previous option is checked. Selecting this option will "
540
  "retain contextual matching for posts and pages but disable this on any "
541
  "custom post types."
542
  msgstr ""
543
 
544
+ #: includes/admin/default-settings.php:523
545
+ #: includes/admin/default-settings.php:709
546
+ #: includes/blocks/related-posts/src/edit.js:203
547
  msgid "Location of the post thumbnail"
548
  msgstr ""
549
 
550
+ #: includes/admin/default-settings.php:528
551
+ #: includes/admin/default-settings.php:714
552
  msgid "Display thumbnails inline with posts, before title"
553
  msgstr ""
554
 
555
+ #: includes/admin/default-settings.php:529
556
+ #: includes/admin/default-settings.php:715
557
  msgid "Display thumbnails inline with posts, after title"
558
  msgstr ""
559
 
560
+ #: includes/admin/default-settings.php:530
561
+ #: includes/admin/default-settings.php:716
562
  msgid "Display only thumbnails, no text"
563
  msgstr ""
564
 
565
+ #: includes/admin/default-settings.php:531
566
+ #: includes/admin/default-settings.php:717
567
  msgid "Do not display thumbnails, only text"
568
  msgstr ""
569
 
570
+ #: includes/admin/default-settings.php:536
571
  msgid "Thumbnail size"
572
  msgstr ""
573
 
574
+ #: includes/admin/default-settings.php:537
575
  msgid ""
576
  "You can choose from existing image sizes above or create a custom size. If "
577
  "you have chosen Custom size above, then enter the width, height and crop "
579
  "width and/or height below, existing images will not be automatically resized."
580
  msgstr ""
581
 
582
+ #: includes/admin/default-settings.php:539
583
  #, php-format
584
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
585
  msgstr ""
586
 
587
+ #: includes/admin/default-settings.php:549
588
+ #: includes/admin/default-settings.php:722
589
+ #: includes/modules/class-crp-widget.php:125
590
  msgid "Thumbnail width"
591
  msgstr ""
592
 
593
+ #: includes/admin/default-settings.php:558
594
+ #: includes/admin/default-settings.php:731
595
+ #: includes/modules/class-crp-widget.php:120
596
  msgid "Thumbnail height"
597
  msgstr ""
598
 
599
+ #: includes/admin/default-settings.php:567
600
  msgid "Hard crop thumbnails"
601
  msgstr ""
602
 
603
+ #: includes/admin/default-settings.php:568
604
  msgid ""
605
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
606
  "above vs. maintaining proportions."
607
  msgstr ""
608
 
609
+ #: includes/admin/default-settings.php:574
610
  msgid "Generate thumbnail sizes"
611
  msgstr ""
612
 
613
+ #: includes/admin/default-settings.php:575
614
  msgid ""
615
  "If you select this option and Custom size is selected above, the plugin will "
616
  "register the image size with WordPress to create new thumbnails. Does not "
617
  "update old images as explained above."
618
  msgstr ""
619
 
620
+ #: includes/admin/default-settings.php:581
621
  msgid "Thumbnail size attributes"
622
  msgstr ""
623
 
624
+ #: includes/admin/default-settings.php:587
625
  #, php-format
626
  msgid "Use CSS to set the width and height: e.g. %s"
627
  msgstr ""
628
 
629
+ #: includes/admin/default-settings.php:589
630
  #, php-format
631
  msgid "Use HTML attributes to set the width and height: e.g. %s"
632
  msgstr ""
633
 
634
+ #: includes/admin/default-settings.php:590
635
  msgid ""
636
  "No width or height set. You will need to use external styles to force any "
637
  "width or height of your choice."
638
  msgstr ""
639
 
640
+ #: includes/admin/default-settings.php:595
641
  msgid "Thumbnail meta field name"
642
  msgstr ""
643
 
644
+ #: includes/admin/default-settings.php:596
645
  msgid ""
646
  "The value of this field should contain the URL of the image and can be set "
647
  "in the metabox in the Edit Post screen"
648
  msgstr ""
649
 
650
+ #: includes/admin/default-settings.php:602
651
  msgid "Get first image"
652
  msgstr ""
653
 
654
+ #: includes/admin/default-settings.php:603
655
  msgid ""
656
  "The plugin will fetch the first image in the post content if this is "
657
  "enabled. This can slow down the loading of your page if the first image in "
658
  "the followed posts is large in file-size."
659
  msgstr ""
660
 
661
+ #: includes/admin/default-settings.php:609
662
  msgid "Use default thumbnail?"
663
  msgstr ""
664
 
665
+ #: includes/admin/default-settings.php:610
666
  msgid ""
667
  "If checked, when no thumbnail is found, show a default one from the URL "
668
  "below. If not checked and no thumbnail is found, no image will be shown."
669
  msgstr ""
670
 
671
+ #: includes/admin/default-settings.php:616 includes/admin/settings-page.php:763
672
  msgid "Default thumbnail"
673
  msgstr ""
674
 
675
+ #: includes/admin/default-settings.php:617
676
  msgid ""
677
  "Enter the full URL of the image that you wish to display if no thumbnail is "
678
  "found. This image will be displayed below."
679
  msgstr ""
680
 
681
+ #: includes/admin/default-settings.php:647
682
  msgid "Related Posts style"
683
  msgstr ""
684
 
685
+ #: includes/admin/default-settings.php:655
686
  msgid "Custom CSS"
687
  msgstr ""
688
 
689
+ #: includes/admin/default-settings.php:657
690
  #, php-format
691
  msgid ""
692
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
693
  "CSS classes to style."
694
  msgstr ""
695
 
696
+ #: includes/admin/default-settings.php:687
697
  msgid "About this tab"
698
  msgstr ""
699
 
700
+ #: includes/admin/default-settings.php:688
701
  msgid ""
702
  "Below options override the related posts settings for your blog feed. These "
703
  "only apply if you have selected to add related posts to Feeds in the General "
705
  "way to style the related posts in the feed."
706
  msgstr ""
707
 
708
+ #: includes/admin/default-settings.php:808
709
  msgid "No styles"
710
  msgstr ""
711
 
712
+ #: includes/admin/default-settings.php:809
713
  msgid "Select this option if you plan to add your own styles"
714
  msgstr ""
715
 
716
+ #: includes/admin/default-settings.php:813
717
  msgid "Text only"
718
  msgstr ""
719
 
720
+ #: includes/admin/default-settings.php:814
721
  msgid "Disable thumbnails and no longer include the default style sheet"
722
  msgstr ""
723
 
724
+ #: includes/admin/default-settings.php:818
725
  msgid "Rounded thumbnails"
726
  msgstr ""
727
 
728
+ #: includes/admin/default-settings.php:819
729
  msgid ""
730
  "Enabling this option will turn on the thumbnails. It will also turn off the "
731
  "display of the author, excerpt and date if already enabled. Disabling this "
732
  "option will not revert any settings."
733
  msgstr ""
734
 
735
+ #: includes/admin/default-settings.php:823
736
  msgid "Masonry"
737
  msgstr ""
738
 
739
+ #: includes/admin/default-settings.php:824
740
  msgid "Enables a masonry style layout similar to one made famous by Pinterest."
741
  msgstr ""
742
 
743
+ #: includes/admin/default-settings.php:828
744
  msgid "Grid"
745
  msgstr ""
746
 
747
+ #: includes/admin/default-settings.php:829
748
  msgid "Uses CSS Grid for display. Might not work on older browsers."
749
  msgstr ""
750
 
751
+ #: includes/admin/default-settings.php:833
752
  msgid "Rounded thumbnails with CSS grid"
753
  msgstr ""
754
 
755
+ #: includes/admin/default-settings.php:834
756
  msgid ""
757
  "Uses CSS grid. It will also turn off the display of the author, excerpt and "
758
  "date if already enabled. Disabling this option will not revert any settings."
759
  msgstr ""
760
 
761
+ #: includes/admin/default-settings.php:857
762
+ #: includes/blocks/related-posts/src/edit.js:240
763
  msgid "By relevance"
764
  msgstr ""
765
 
766
+ #: includes/admin/default-settings.php:858
767
+ #: includes/blocks/related-posts/src/edit.js:244
768
  msgid "Randomly"
769
  msgstr ""
770
 
771
+ #: includes/admin/default-settings.php:859
772
+ #: includes/blocks/related-posts/src/edit.js:248
773
  msgid "By date"
774
  msgstr ""
775
 
843
  msgid "Contribute"
844
  msgstr ""
845
 
846
+ #: includes/admin/modules/metabox.php:103
847
  msgid "Disable Related Posts display:"
848
  msgstr ""
849
 
850
+ #: includes/admin/modules/metabox.php:106
851
  msgid ""
852
  "If this is checked, then Contextual Related Posts will not automatically "
853
  "insert the related posts at the end of post content."
854
  msgstr ""
855
 
856
+ #: includes/admin/modules/metabox.php:110
857
  msgid "Exclude this post from the related posts list:"
858
  msgstr ""
859
 
860
+ #: includes/admin/modules/metabox.php:113
861
  msgid ""
862
  "If this is checked, then this post will be excluded from the popular posts "
863
  "list."
864
  msgstr ""
865
 
866
+ #: includes/admin/modules/metabox.php:117
867
  msgid "Keyword:"
868
  msgstr ""
869
 
870
+ #: includes/admin/modules/metabox.php:119
871
  msgid ""
872
  "Enter either a word or a phrase that will be used to find related posts. If "
873
  "entered, the plugin will continue to search the `post_title` and "
875
  "title and content of this post."
876
  msgstr ""
877
 
878
+ #: includes/admin/modules/metabox.php:123
879
  msgid "Exclude terms:"
880
  msgstr ""
881
 
882
+ #: includes/admin/modules/metabox.php:125
883
  msgid ""
884
  "Enter a comma-separated list of terms. If a related post's title or content "
885
  "contains any of these terms then it will be excluded from the results."
886
  msgstr ""
887
 
888
+ #: includes/admin/modules/metabox.php:129
889
+ #: includes/admin/modules/metabox.php:137
890
  msgid "Manual related posts:"
891
  msgstr ""
892
 
893
+ #: includes/admin/modules/metabox.php:131
894
  msgid ""
895
  "Comma separated list of post, page or custom post type IDs. e.g. "
896
  "188,320,500. These will be given preference over the related posts generated "
897
  "by the plugin."
898
  msgstr ""
899
 
900
+ #: includes/admin/modules/metabox.php:132
901
  msgid ""
902
  "Once you enter the list above and save this page, the plugin will display "
903
  "the titles of the posts below for your reference. Only IDs corresponding to "
904
  "published posts or custom post types will be retained."
905
  msgstr ""
906
 
907
+ #: includes/admin/modules/metabox.php:148
908
+ #: includes/admin/modules/metabox.php:177
909
  #, php-format
910
  msgid "This post type is: %s"
911
  msgstr ""
912
 
913
+ #: includes/admin/modules/metabox.php:159
914
+ msgid "Exclude post IDs:"
915
+ msgstr ""
916
+
917
+ #: includes/admin/modules/metabox.php:161
918
+ msgid ""
919
+ "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500."
920
+ msgstr ""
921
+
922
+ #: includes/admin/modules/metabox.php:166
923
+ msgid "Excluded posts:"
924
+ msgstr ""
925
+
926
+ #: includes/admin/modules/metabox.php:188
927
  msgid "Location of thumbnail"
928
  msgstr ""
929
 
930
+ #: includes/admin/modules/metabox.php:190
931
  msgid ""
932
  "Enter the full URL to the image (JPG, PNG or GIF) you'd like to use. This "
933
  "image will be used for the post. It will be resized to the thumbnail size "
934
  "set under Settings &raquo; Related Posts &raquo; Output Options"
935
  msgstr ""
936
 
937
+ #: includes/admin/modules/metabox.php:191
938
  msgid "The URL above is saved in the meta field:"
939
  msgstr ""
940
 
941
+ #: includes/admin/modules/metabox.php:196
942
  msgid ""
943
  "You have Top 10 WordPress Plugin installed. If you are trying to modify the "
944
  "thumbnail, then you'll need to make the same change in the Top 10 meta box "
971
 
972
  #: includes/admin/modules/tools.php:75
973
  msgid ""
974
+ "Clear the Contextual Related Posts cache. Contextual Related Posts includes "
975
+ "an inbuilt cache expiry mechanism so you'll need this when you want to wipe "
976
+ "out the cache."
977
  msgstr ""
978
 
979
  #: includes/admin/modules/tools.php:78 includes/admin/modules/tools.php:80
1115
  msgid "Modified from default setting"
1116
  msgstr ""
1117
 
1118
+ #: includes/admin/settings-page.php:462
1119
+ msgid " cropped"
1120
+ msgstr ""
1121
+
1122
+ #: includes/admin/settings-page.php:707
1123
  msgctxt "tag delimiter"
1124
  msgid ","
1125
  msgstr ""
1126
 
1127
+ #: includes/admin/settings-page.php:785
1128
  msgid ""
1129
  "This option cannot be changed because of the selected related posts style. "
1130
  "To modify this option, you will need to select No styles or Text only in the "
1131
  "Styles tab"
1132
  msgstr ""
1133
 
1134
+ #: includes/admin/settings-page.php:789
1135
  msgid ""
1136
  "This option cannot be changed because of the selected related posts style. "
1137
  "To modify this option, you will need to select No styles in the Styles tab"
1185
  msgid "Follow me"
1186
  msgstr ""
1187
 
1188
+ #: includes/blocks/related-posts/src/edit.js:105
1189
+ msgid "Related Posts Settings"
1190
+ msgstr ""
1191
+
1192
+ #: includes/blocks/related-posts/src/edit.js:111
1193
+ msgid "Show heading"
1194
+ msgstr ""
1195
+
1196
+ #: includes/blocks/related-posts/src/edit.js:114
1197
+ msgid "Heading displayed"
1198
+ msgstr ""
1199
+
1200
+ #: includes/blocks/related-posts/src/edit.js:115
1201
+ msgid "No Heading displayed"
1202
+ msgstr ""
1203
+
1204
+ #: includes/blocks/related-posts/src/edit.js:125
1205
+ #: includes/modules/class-crp-rest-api.php:165
1206
+ msgid "Number of posts"
1207
+ msgstr ""
1208
+
1209
+ #: includes/blocks/related-posts/src/edit.js:129
1210
+ msgid "Maximum number of posts to display"
1211
+ msgstr ""
1212
+
1213
+ #: includes/blocks/related-posts/src/edit.js:138
1214
+ #: includes/modules/class-crp-widget.php:91
1215
+ msgid "Offset"
1216
+ msgstr ""
1217
+
1218
+ #: includes/blocks/related-posts/src/edit.js:142
1219
+ msgid "Number of posts to skip from the top"
1220
+ msgstr ""
1221
+
1222
+ #: includes/blocks/related-posts/src/edit.js:151
1223
+ msgid "Show excerpt"
1224
+ msgstr ""
1225
+
1226
+ #: includes/blocks/related-posts/src/edit.js:154
1227
+ msgid "Excerpt displayed"
1228
+ msgstr ""
1229
+
1230
+ #: includes/blocks/related-posts/src/edit.js:155
1231
+ msgid "No excerpt"
1232
+ msgstr ""
1233
+
1234
+ #: includes/blocks/related-posts/src/edit.js:169
1235
+ msgid "\"by Author Name\" displayed"
1236
+ msgstr ""
1237
+
1238
+ #: includes/blocks/related-posts/src/edit.js:172
1239
+ msgid "No author displayed"
1240
+ msgstr ""
1241
+
1242
+ #: includes/blocks/related-posts/src/edit.js:185
1243
+ msgid "Date of post displayed"
1244
+ msgstr ""
1245
+
1246
+ #: includes/blocks/related-posts/src/edit.js:187
1247
+ msgid "Date of post not displayed"
1248
+ msgstr ""
1249
+
1250
+ #: includes/blocks/related-posts/src/edit.js:199
1251
+ msgid "Thumbnail option"
1252
+ msgstr ""
1253
+
1254
+ #: includes/blocks/related-posts/src/edit.js:209
1255
+ msgid "Before title"
1256
+ msgstr ""
1257
+
1258
+ #: includes/blocks/related-posts/src/edit.js:213
1259
+ msgid "After title"
1260
+ msgstr ""
1261
+
1262
+ #: includes/blocks/related-posts/src/edit.js:217
1263
+ msgid "Only thumbnail"
1264
+ msgstr ""
1265
+
1266
+ #: includes/blocks/related-posts/src/edit.js:221
1267
+ msgid "Only text"
1268
+ msgstr ""
1269
+
1270
+ #: includes/blocks/related-posts/src/edit.js:234
1271
+ msgid "This option directly edits the query"
1272
+ msgstr ""
1273
+
1274
+ #: includes/blocks/related-posts/src/edit.js:261
1275
+ msgid "Posts are shuffled on each load"
1276
+ msgstr ""
1277
+
1278
+ #: includes/blocks/related-posts/src/edit.js:265
1279
+ msgid "Posts displayed based on above setting"
1280
+ msgstr ""
1281
+
1282
+ #: includes/blocks/related-posts/src/edit.js:277
1283
+ msgid "Other attributes"
1284
+ msgstr ""
1285
+
1286
+ #: includes/blocks/related-posts/src/edit.js:281
1287
+ msgid ""
1288
+ "Enter other attributes in a URL-style string-query. e.g. post_types=post,"
1289
+ "page&link_nofollow=1&exclude_post_ids=5,6"
1290
+ msgstr ""
1291
+
1292
+ #: includes/main-query.php:204
1293
  #, php-format
1294
  msgid ""
1295
  "Powered by <a href=\"%s\" rel=\"nofollow\" style=\"float:none\">Contextual "
1308
  msgid "Post ID."
1309
  msgstr ""
1310
 
 
 
 
 
1311
  #: includes/modules/class-crp-rest-api.php:170
1312
  msgid "Post types (comma separated)"
1313
  msgstr ""
1328
  msgid "Taxonomy IDs from which posts are excluded (comma separated)"
1329
  msgstr ""
1330
 
1331
+ #: includes/modules/class-crp-widget.php:29
1332
+ msgid "Related Posts [CRP]"
1333
+ msgstr ""
1334
+
1335
  #: includes/modules/class-crp-widget.php:31
1336
  msgid "Display Related Posts"
1337
  msgstr ""
1338
 
1339
+ #: includes/modules/class-crp-widget.php:81
1340
  msgid "Title"
1341
  msgstr ""
1342
 
1343
+ #: includes/modules/class-crp-widget.php:86
1344
+ msgid "No. of posts"
1345
+ msgstr ""
1346
+
1347
+ #: includes/modules/class-crp-widget.php:96
1348
  msgid " Show excerpt?"
1349
  msgstr ""
1350
 
1351
+ #: includes/modules/class-crp-widget.php:101
1352
  msgid " Show author?"
1353
  msgstr ""
1354
 
1355
+ #: includes/modules/class-crp-widget.php:106
1356
  msgid " Show date?"
1357
  msgstr ""
1358
 
1359
+ #: includes/modules/class-crp-widget.php:110
1360
+ msgid "Thumbnail options"
1361
+ msgstr ""
1362
+
1363
+ #: includes/modules/class-crp-widget.php:112
1364
  msgid "Thumbnails inline, before title"
1365
  msgstr ""
1366
 
1367
+ #: includes/modules/class-crp-widget.php:113
1368
  msgid "Thumbnails inline, after title"
1369
  msgstr ""
1370
 
1371
+ #: includes/modules/class-crp-widget.php:114
1372
  msgid "Only thumbnails, no text"
1373
  msgstr ""
1374
 
1375
+ #: includes/modules/class-crp-widget.php:115
1376
  msgid "No thumbnails, only text."
1377
  msgstr ""
1378
 
1379
+ #: includes/modules/class-crp-widget.php:142
1380
  msgid " Randomize posts"
1381
  msgstr ""
1382
 
1383
+ #: includes/modules/class-crp-widget.php:147
1384
+ msgid "Only from categories (comma-separated list of term taxonomy IDs)"
1385
  msgstr ""
1386
 
1387
+ #: includes/output-generator.php:239
1388
  msgid " by "
1389
  msgstr ""
1390
 
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: 2022-01-29 14:35+0000\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza\n"
9
  "Language-Team: WebberZone\n"
@@ -24,7 +24,7 @@ msgstr ""
24
  msgid "Contextual Related Posts"
25
  msgstr ""
26
 
27
- #: includes/admin/admin.php:32 includes/admin/default-settings.php:215
28
  #: includes/deprecated.php:147
29
  msgid "Related Posts"
30
  msgstr ""
@@ -45,115 +45,6 @@ msgid ""
45
  "\"%2$s\" target=\"_blank\">WordPress.org</a>"
46
  msgstr ""
47
 
48
- #: includes/admin/blocks/related-posts/index.js:22
49
- #: includes/admin/blocks/related-posts/index.min.js:1
50
- #: includes/modules/class-crp-widget.php:29
51
- msgid "Related Posts [CRP]"
52
- msgstr ""
53
-
54
- #: includes/admin/blocks/related-posts/index.js:23
55
- #: includes/admin/blocks/related-posts/index.min.js:1
56
- msgid "Display related posts by Contextual Related Posts"
57
- msgstr ""
58
-
59
- #: includes/admin/blocks/related-posts/index.js:26
60
- #: includes/admin/blocks/related-posts/index.min.js:1
61
- msgid "related posts"
62
- msgstr ""
63
-
64
- #: includes/admin/blocks/related-posts/index.js:26
65
- #: includes/admin/blocks/related-posts/index.min.js:1
66
- msgid "contextual"
67
- msgstr ""
68
-
69
- #: includes/admin/blocks/related-posts/index.js:26
70
- #: includes/admin/blocks/related-posts/index.min.js:1
71
- msgid "posts"
72
- msgstr ""
73
-
74
- #: includes/admin/blocks/related-posts/index.js:141
75
- #: includes/admin/blocks/related-posts/index.min.js:1
76
- msgid "Show heading"
77
- msgstr ""
78
-
79
- #: includes/admin/blocks/related-posts/index.js:146
80
- #: includes/admin/blocks/related-posts/index.min.js:1
81
- #: includes/modules/class-crp-widget.php:87
82
- msgid "No. of posts"
83
- msgstr ""
84
-
85
- #: includes/admin/blocks/related-posts/index.js:157
86
- #: includes/admin/blocks/related-posts/index.min.js:1
87
- #: includes/modules/class-crp-widget.php:92
88
- msgid "Offset"
89
- msgstr ""
90
-
91
- #: includes/admin/blocks/related-posts/index.js:168
92
- #: includes/admin/blocks/related-posts/index.min.js:1
93
- msgid "Show excerpt"
94
- msgstr ""
95
-
96
- #: includes/admin/blocks/related-posts/index.js:173
97
- #: includes/admin/blocks/related-posts/index.min.js:1
98
- #: includes/admin/default-settings.php:262
99
- msgid "Show author"
100
- msgstr ""
101
-
102
- #: includes/admin/blocks/related-posts/index.js:178
103
- #: includes/admin/blocks/related-posts/index.min.js:1
104
- #: includes/admin/default-settings.php:255
105
- msgid "Show date"
106
- msgstr ""
107
-
108
- #: includes/admin/blocks/related-posts/index.js:184
109
- #: includes/admin/blocks/related-posts/index.min.js:1
110
- #: includes/modules/class-crp-widget.php:111
111
- msgid "Thumbnail options"
112
- msgstr ""
113
-
114
- #: includes/admin/blocks/related-posts/index.js:187
115
- #: includes/admin/blocks/related-posts/index.min.js:1
116
- msgid "Before title"
117
- msgstr ""
118
-
119
- #: includes/admin/blocks/related-posts/index.js:188
120
- #: includes/admin/blocks/related-posts/index.min.js:1
121
- msgid "After title"
122
- msgstr ""
123
-
124
- #: includes/admin/blocks/related-posts/index.js:189
125
- #: includes/admin/blocks/related-posts/index.min.js:1
126
- msgid "Only thumbnail"
127
- msgstr ""
128
-
129
- #: includes/admin/blocks/related-posts/index.js:190
130
- #: includes/admin/blocks/related-posts/index.min.js:1
131
- msgid "Only text"
132
- msgstr ""
133
-
134
- #: includes/admin/blocks/related-posts/index.js:195
135
- #: includes/admin/blocks/related-posts/index.min.js:1
136
- msgid "Ordering"
137
- msgstr ""
138
-
139
- #: includes/admin/blocks/related-posts/index.js:200
140
- #: includes/admin/blocks/related-posts/index.min.js:1
141
- #: includes/admin/default-settings.php:406
142
- msgid "Randomize posts"
143
- msgstr ""
144
-
145
- #: includes/admin/blocks/related-posts/index.js:205
146
- #: includes/admin/blocks/related-posts/index.min.js:1
147
- msgid "Other attributes"
148
- msgstr ""
149
-
150
- #: includes/admin/blocks/related-posts/index.js:206
151
- #: includes/admin/blocks/related-posts/index.min.js:1
152
- msgid ""
153
- "Enter other attributes in a URL-style string-query. e.g. post_types=post,"
154
- "page&link_nofollow=1&exclude_post_ids=5,6"
155
- msgstr ""
156
-
157
  #: includes/admin/default-settings.php:62
158
  msgid "Cache posts only"
159
  msgstr ""
@@ -186,7 +77,9 @@ msgstr ""
186
  #, php-format
187
  msgid ""
188
  "If you choose to disable this, please add %1$s to your template file where "
189
- "you want it displayed"
 
 
190
  msgstr ""
191
 
192
  #: includes/admin/default-settings.php:85
@@ -240,269 +133,265 @@ msgid ""
240
  msgstr ""
241
 
242
  #: includes/admin/default-settings.php:111
243
- msgid "Only from same"
244
- msgstr ""
245
-
246
- #: includes/admin/default-settings.php:112
247
- msgid ""
248
- "Limit the related posts only to the categories, tags, and/or taxonomies of "
249
- "the current post."
250
- msgstr ""
251
-
252
- #: includes/admin/default-settings.php:118
253
- msgid "Match all taxonomies"
254
- msgstr ""
255
-
256
- #: includes/admin/default-settings.php:119
257
- msgid ""
258
- "If enabled, then it will only select posts that match all the above selected "
259
- "taxonomies. This can result in no related posts being found."
260
- msgstr ""
261
-
262
- #: includes/admin/default-settings.php:125
263
- msgid "Number of common terms"
264
- msgstr ""
265
-
266
- #: includes/admin/default-settings.php:126
267
- msgid ""
268
- "Enter the minimum number of common terms that have to be matched before a "
269
- "post is considered related."
270
- msgstr ""
271
-
272
- #: includes/admin/default-settings.php:133
273
  msgid "Disable on mobile devices"
274
  msgstr ""
275
 
276
- #: includes/admin/default-settings.php:134
277
  msgid ""
278
  "Disable display of related posts on mobile devices. Might not always work "
279
  "with caching plugins."
280
  msgstr ""
281
 
282
- #: includes/admin/default-settings.php:140
283
  msgid "Disable on AMP pages"
284
  msgstr ""
285
 
286
- #: includes/admin/default-settings.php:141
287
  msgid "Disable display of related posts on AMP pages."
288
  msgstr ""
289
 
290
- #: includes/admin/default-settings.php:147
291
  msgid "Delete options on uninstall"
292
  msgstr ""
293
 
294
- #: includes/admin/default-settings.php:148
295
  msgid ""
296
  "If this is checked, all settings related to Contextual Related Posts are "
297
  "removed from the database if you choose to uninstall/delete the plugin."
298
  msgstr ""
299
 
300
- #: includes/admin/default-settings.php:154
301
  msgid "Delete FULLTEXT indices on uninstall"
302
  msgstr ""
303
 
304
- #: includes/admin/default-settings.php:155
305
  msgid ""
306
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
307
  "are removed from the database if you choose to uninstall/delete the plugin."
308
  msgstr ""
309
 
310
- #: includes/admin/default-settings.php:161
311
  msgid "Delete FULLTEXT indices on deactivate"
312
  msgstr ""
313
 
314
- #: includes/admin/default-settings.php:162
315
  msgid ""
316
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
317
  "are removed from the database if you choose to deactivate the plugin."
318
  msgstr ""
319
 
320
- #: includes/admin/default-settings.php:168
321
  msgid "Show metabox"
322
  msgstr ""
323
 
324
- #: includes/admin/default-settings.php:169
325
  msgid ""
326
  "This will add the Contextual Related Posts metabox on Edit Posts or Add New "
327
  "Posts screens. Also applies to Pages and Custom Post Types."
328
  msgstr ""
329
 
330
- #: includes/admin/default-settings.php:175
331
  msgid "Limit meta box to Admins only"
332
  msgstr ""
333
 
334
- #: includes/admin/default-settings.php:176
335
  msgid ""
336
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
337
  "default, Contributors and above will be able to see the meta box. Applies "
338
  "only if the above option is selected."
339
  msgstr ""
340
 
341
- #: includes/admin/default-settings.php:182
342
  msgid "Link to Contextual Related Posts plugin page"
343
  msgstr ""
344
 
345
- #: includes/admin/default-settings.php:183
346
  msgid ""
347
  "A no-follow link to the plugin homepage will be added as the last item of "
348
  "the related posts."
349
  msgstr ""
350
 
351
- #: includes/admin/default-settings.php:212
352
  msgid "Heading of posts"
353
  msgstr ""
354
 
355
- #: includes/admin/default-settings.php:213
356
  msgid "Displayed before the list of the posts as a master heading"
357
  msgstr ""
358
 
359
- #: includes/admin/default-settings.php:220
360
  msgid "Show when no posts are found"
361
  msgstr ""
362
 
363
- #: includes/admin/default-settings.php:226
364
  msgid "Blank output"
365
  msgstr ""
366
 
367
- #: includes/admin/default-settings.php:227
368
  msgid "Display custom text"
369
  msgstr ""
370
 
371
- #: includes/admin/default-settings.php:232
372
  msgid "Custom text"
373
  msgstr ""
374
 
375
- #: includes/admin/default-settings.php:233
376
  msgid ""
377
  "Enter the custom text that will be displayed if the second option is "
378
  "selected above."
379
  msgstr ""
380
 
381
- #: includes/admin/default-settings.php:235 includes/deprecated.php:149
382
  msgid "No related posts found"
383
  msgstr ""
384
 
385
- #: includes/admin/default-settings.php:239
386
- #: includes/admin/default-settings.php:694
387
  msgid "Show post excerpt"
388
  msgstr ""
389
 
390
- #: includes/admin/default-settings.php:240
391
  msgid ""
392
  "If the post does not have an excerpt, the plugin will automatically create "
393
  "one containing the number of words specified in the next option."
394
  msgstr ""
395
 
396
- #: includes/admin/default-settings.php:246
397
  msgid "Length of excerpt (in words)"
398
  msgstr ""
399
 
400
- #: includes/admin/default-settings.php:256
 
 
 
 
 
401
  msgid ""
402
  "Displays the date of the post. Uses the same date format set in General "
403
  "Options."
404
  msgstr ""
405
 
406
- #: includes/admin/default-settings.php:269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  msgid "Limit post title length (in characters)"
408
  msgstr ""
409
 
410
- #: includes/admin/default-settings.php:270
411
  msgid ""
412
  "Any title longer than the number of characters set above will be cut and "
413
  "appended with an ellipsis (&hellip;)"
414
  msgstr ""
415
 
416
- #: includes/admin/default-settings.php:278
417
  msgid "Open links in new window"
418
  msgstr ""
419
 
420
- #: includes/admin/default-settings.php:285
421
  msgid "Add nofollow to links"
422
  msgstr ""
423
 
424
- #: includes/admin/default-settings.php:292
425
  msgid "Exclusion settings"
426
  msgstr ""
427
 
428
- #: includes/admin/default-settings.php:298
429
  msgid "Exclude display on these posts"
430
  msgstr ""
431
 
432
- #: includes/admin/default-settings.php:299
433
  msgid ""
434
  "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500"
435
  msgstr ""
436
 
437
- #: includes/admin/default-settings.php:305
438
  msgid "Exclude display on these post types"
439
  msgstr ""
440
 
441
- #: includes/admin/default-settings.php:306
442
  msgid ""
443
  "The related posts will not display on any of the above selected post types."
444
  msgstr ""
445
 
446
- #: includes/admin/default-settings.php:312
447
- msgid "Exclude on Categories"
448
  msgstr ""
449
 
450
- #: includes/admin/default-settings.php:313
451
- #: includes/admin/default-settings.php:459
452
  msgid ""
453
- "Comma separated list of category slugs. The field above has an autocomplete "
454
- "so simply start typing in the starting letters and it will prompt you with "
455
- "options. Does not support custom taxonomies."
456
  msgstr ""
457
 
458
- #: includes/admin/default-settings.php:324
459
  msgid "HTML to display"
460
  msgstr ""
461
 
462
- #: includes/admin/default-settings.php:330
463
  msgid "Before the list of posts"
464
  msgstr ""
465
 
466
- #: includes/admin/default-settings.php:337
467
  msgid "After the list of posts"
468
  msgstr ""
469
 
470
- #: includes/admin/default-settings.php:344
471
  msgid "Before each list item"
472
  msgstr ""
473
 
474
- #: includes/admin/default-settings.php:351
475
  msgid "After each list item"
476
  msgstr ""
477
 
478
- #: includes/admin/default-settings.php:381
479
- #: includes/admin/default-settings.php:685
480
  msgid "Number of posts to display"
481
  msgstr ""
482
 
483
- #: includes/admin/default-settings.php:382
484
  msgid ""
485
  "Maximum number of posts that will be displayed in the list. This option is "
486
  "used if you do not specify the number of posts in the widget or shortcodes"
487
  msgstr ""
488
 
489
- #: includes/admin/default-settings.php:390
490
  msgid "Related posts should be newer than"
491
  msgstr ""
492
 
493
- #: includes/admin/default-settings.php:391
494
  msgid ""
495
  "This sets the cut-off period for which posts will be displayed. e.g. setting "
496
  "it to 365 will show related posts from the last year only. Set to 0 to "
497
  "disable limiting posts by date."
498
  msgstr ""
499
 
500
- #: includes/admin/default-settings.php:398
501
- #: includes/modules/class-crp-widget.php:129
 
502
  msgid "Order posts"
503
  msgstr ""
504
 
505
- #: includes/admin/default-settings.php:407
 
 
 
 
 
506
  msgid ""
507
  "This shuffles the selected related posts. If you select to order by date in "
508
  "the previous option, then the related posts will first be sorted by date and "
@@ -510,79 +399,120 @@ msgid ""
510
  "enabled."
511
  msgstr ""
512
 
513
- #: includes/admin/default-settings.php:413
514
  msgid "Related posts based on title and content"
515
  msgstr ""
516
 
517
- #: includes/admin/default-settings.php:414
518
  msgid ""
519
  "If unchecked, only posts titles are used. Enable the cache if enabling this "
520
  "option for better performance. Each site is different, so toggle this option "
521
  "to see which setting gives you better quality related posts."
522
  msgstr ""
523
 
524
- #: includes/admin/default-settings.php:420
525
  msgid "Limit content to be compared"
526
  msgstr ""
527
 
528
- #: includes/admin/default-settings.php:422
529
  #, php-format
530
  msgid ""
531
  "This sets the maximum words of the content that will be matched. Set to 0 "
532
  "for no limit. Max value: %1$s. Only applies if you activate the above option."
533
  msgstr ""
534
 
535
- #: includes/admin/default-settings.php:430
536
- #: includes/modules/class-crp-widget.php:153
537
  msgid "Post types to include"
538
  msgstr ""
539
 
540
- #: includes/admin/default-settings.php:431
541
  msgid ""
542
  "At least one option should be selected above. Select which post types you "
543
  "want to include in the list of posts. This field can be overridden using a "
544
  "comma separated list of post types when using the manual display."
545
  msgstr ""
546
 
547
- #: includes/admin/default-settings.php:437
548
  msgid "Limit to same post type"
549
  msgstr ""
550
 
551
- #: includes/admin/default-settings.php:438
552
  msgid ""
553
  "If checked, the related posts will only be selected from the same post type "
554
  "of the current post."
555
  msgstr ""
556
 
557
- #: includes/admin/default-settings.php:444
558
  msgid "Limit to same author"
559
  msgstr ""
560
 
561
- #: includes/admin/default-settings.php:445
562
  msgid ""
563
  "If checked, the related posts will only be selected from the same author of "
564
  "the current post."
565
  msgstr ""
566
 
567
- #: includes/admin/default-settings.php:451
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
  msgid "Post/page IDs to exclude"
569
  msgstr ""
570
 
571
- #: includes/admin/default-settings.php:452
572
  msgid ""
573
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
574
  "188,320,500"
575
  msgstr ""
576
 
577
- #: includes/admin/default-settings.php:458
578
- msgid "Exclude Categories"
579
  msgstr ""
580
 
581
- #: includes/admin/default-settings.php:470
582
- msgid "Exclude category IDs"
583
  msgstr ""
584
 
585
- #: includes/admin/default-settings.php:471
586
  msgid ""
587
  "This is a readonly field that is automatically populated based on the above "
588
  "input when the settings are saved. These might differ from the IDs visible "
@@ -590,59 +520,59 @@ msgid ""
590
  "the term_taxonomy_id which is unique to this taxonomy."
591
  msgstr ""
592
 
593
- #: includes/admin/default-settings.php:478
594
  msgid "Disable contextual matching"
595
  msgstr ""
596
 
597
- #: includes/admin/default-settings.php:479
598
  msgid ""
599
  "Selecting this option will turn off contextual matching. This is only useful "
600
- "if you activate the option: \"Only from same\" from the General tab. "
601
- "Otherwise, you will end up with the same set of related posts on all pages "
602
- "with no relevance."
603
  msgstr ""
604
 
605
- #: includes/admin/default-settings.php:485
606
  msgid "Disable contextual matching ONLY on attachments and custom post types"
607
  msgstr ""
608
 
609
- #: includes/admin/default-settings.php:486
610
  msgid ""
611
  "Applies only if the previous option is checked. Selecting this option will "
612
  "retain contextual matching for posts and pages but disable this on any "
613
  "custom post types."
614
  msgstr ""
615
 
616
- #: includes/admin/default-settings.php:515
617
- #: includes/admin/default-settings.php:701
 
618
  msgid "Location of the post thumbnail"
619
  msgstr ""
620
 
621
- #: includes/admin/default-settings.php:520
622
- #: includes/admin/default-settings.php:706
623
  msgid "Display thumbnails inline with posts, before title"
624
  msgstr ""
625
 
626
- #: includes/admin/default-settings.php:521
627
- #: includes/admin/default-settings.php:707
628
  msgid "Display thumbnails inline with posts, after title"
629
  msgstr ""
630
 
631
- #: includes/admin/default-settings.php:522
632
- #: includes/admin/default-settings.php:708
633
  msgid "Display only thumbnails, no text"
634
  msgstr ""
635
 
636
- #: includes/admin/default-settings.php:523
637
- #: includes/admin/default-settings.php:709
638
  msgid "Do not display thumbnails, only text"
639
  msgstr ""
640
 
641
- #: includes/admin/default-settings.php:528
642
  msgid "Thumbnail size"
643
  msgstr ""
644
 
645
- #: includes/admin/default-settings.php:529
646
  msgid ""
647
  "You can choose from existing image sizes above or create a custom size. If "
648
  "you have chosen Custom size above, then enter the width, height and crop "
@@ -650,125 +580,125 @@ msgid ""
650
  "width and/or height below, existing images will not be automatically resized."
651
  msgstr ""
652
 
653
- #: includes/admin/default-settings.php:531
654
  #, php-format
655
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
656
  msgstr ""
657
 
658
- #: includes/admin/default-settings.php:541
659
- #: includes/admin/default-settings.php:714
660
- #: includes/modules/class-crp-widget.php:126
661
  msgid "Thumbnail width"
662
  msgstr ""
663
 
664
- #: includes/admin/default-settings.php:550
665
- #: includes/admin/default-settings.php:723
666
- #: includes/modules/class-crp-widget.php:121
667
  msgid "Thumbnail height"
668
  msgstr ""
669
 
670
- #: includes/admin/default-settings.php:559
671
  msgid "Hard crop thumbnails"
672
  msgstr ""
673
 
674
- #: includes/admin/default-settings.php:560
675
  msgid ""
676
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
677
  "above vs. maintaining proportions."
678
  msgstr ""
679
 
680
- #: includes/admin/default-settings.php:566
681
  msgid "Generate thumbnail sizes"
682
  msgstr ""
683
 
684
- #: includes/admin/default-settings.php:567
685
  msgid ""
686
  "If you select this option and Custom size is selected above, the plugin will "
687
  "register the image size with WordPress to create new thumbnails. Does not "
688
  "update old images as explained above."
689
  msgstr ""
690
 
691
- #: includes/admin/default-settings.php:573
692
  msgid "Thumbnail size attributes"
693
  msgstr ""
694
 
695
- #: includes/admin/default-settings.php:579
696
  #, php-format
697
  msgid "Use CSS to set the width and height: e.g. %s"
698
  msgstr ""
699
 
700
- #: includes/admin/default-settings.php:581
701
  #, php-format
702
  msgid "Use HTML attributes to set the width and height: e.g. %s"
703
  msgstr ""
704
 
705
- #: includes/admin/default-settings.php:582
706
  msgid ""
707
  "No width or height set. You will need to use external styles to force any "
708
  "width or height of your choice."
709
  msgstr ""
710
 
711
- #: includes/admin/default-settings.php:587
712
  msgid "Thumbnail meta field name"
713
  msgstr ""
714
 
715
- #: includes/admin/default-settings.php:588
716
  msgid ""
717
  "The value of this field should contain the URL of the image and can be set "
718
  "in the metabox in the Edit Post screen"
719
  msgstr ""
720
 
721
- #: includes/admin/default-settings.php:594
722
  msgid "Get first image"
723
  msgstr ""
724
 
725
- #: includes/admin/default-settings.php:595
726
  msgid ""
727
  "The plugin will fetch the first image in the post content if this is "
728
  "enabled. This can slow down the loading of your page if the first image in "
729
  "the followed posts is large in file-size."
730
  msgstr ""
731
 
732
- #: includes/admin/default-settings.php:601
733
  msgid "Use default thumbnail?"
734
  msgstr ""
735
 
736
- #: includes/admin/default-settings.php:602
737
  msgid ""
738
  "If checked, when no thumbnail is found, show a default one from the URL "
739
  "below. If not checked and no thumbnail is found, no image will be shown."
740
  msgstr ""
741
 
742
- #: includes/admin/default-settings.php:608 includes/admin/settings-page.php:747
743
  msgid "Default thumbnail"
744
  msgstr ""
745
 
746
- #: includes/admin/default-settings.php:609
747
  msgid ""
748
  "Enter the full URL of the image that you wish to display if no thumbnail is "
749
  "found. This image will be displayed below."
750
  msgstr ""
751
 
752
- #: includes/admin/default-settings.php:639
753
  msgid "Related Posts style"
754
  msgstr ""
755
 
756
- #: includes/admin/default-settings.php:647
757
  msgid "Custom CSS"
758
  msgstr ""
759
 
760
- #: includes/admin/default-settings.php:649
761
  #, php-format
762
  msgid ""
763
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
764
  "CSS classes to style."
765
  msgstr ""
766
 
767
- #: includes/admin/default-settings.php:679
768
  msgid "About this tab"
769
  msgstr ""
770
 
771
- #: includes/admin/default-settings.php:680
772
  msgid ""
773
  "Below options override the related posts settings for your blog feed. These "
774
  "only apply if you have selected to add related posts to Feeds in the General "
@@ -776,68 +706,71 @@ msgid ""
776
  "way to style the related posts in the feed."
777
  msgstr ""
778
 
779
- #: includes/admin/default-settings.php:800
780
  msgid "No styles"
781
  msgstr ""
782
 
783
- #: includes/admin/default-settings.php:801
784
  msgid "Select this option if you plan to add your own styles"
785
  msgstr ""
786
 
787
- #: includes/admin/default-settings.php:805
788
  msgid "Text only"
789
  msgstr ""
790
 
791
- #: includes/admin/default-settings.php:806
792
  msgid "Disable thumbnails and no longer include the default style sheet"
793
  msgstr ""
794
 
795
- #: includes/admin/default-settings.php:810
796
  msgid "Rounded thumbnails"
797
  msgstr ""
798
 
799
- #: includes/admin/default-settings.php:811
800
  msgid ""
801
  "Enabling this option will turn on the thumbnails. It will also turn off the "
802
  "display of the author, excerpt and date if already enabled. Disabling this "
803
  "option will not revert any settings."
804
  msgstr ""
805
 
806
- #: includes/admin/default-settings.php:815
807
  msgid "Masonry"
808
  msgstr ""
809
 
810
- #: includes/admin/default-settings.php:816
811
  msgid "Enables a masonry style layout similar to one made famous by Pinterest."
812
  msgstr ""
813
 
814
- #: includes/admin/default-settings.php:820
815
  msgid "Grid"
816
  msgstr ""
817
 
818
- #: includes/admin/default-settings.php:821
819
  msgid "Uses CSS Grid for display. Might not work on older browsers."
820
  msgstr ""
821
 
822
- #: includes/admin/default-settings.php:825
823
  msgid "Rounded thumbnails with CSS grid"
824
  msgstr ""
825
 
826
- #: includes/admin/default-settings.php:826
827
  msgid ""
828
  "Uses CSS grid. It will also turn off the display of the author, excerpt and "
829
  "date if already enabled. Disabling this option will not revert any settings."
830
  msgstr ""
831
 
832
- #: includes/admin/default-settings.php:849
 
833
  msgid "By relevance"
834
  msgstr ""
835
 
836
- #: includes/admin/default-settings.php:850
 
837
  msgid "Randomly"
838
  msgstr ""
839
 
840
- #: includes/admin/default-settings.php:851
 
841
  msgid "By date"
842
  msgstr ""
843
 
@@ -911,31 +844,31 @@ msgstr ""
911
  msgid "Contribute"
912
  msgstr ""
913
 
914
- #: includes/admin/modules/metabox.php:99
915
  msgid "Disable Related Posts display:"
916
  msgstr ""
917
 
918
- #: includes/admin/modules/metabox.php:102
919
  msgid ""
920
  "If this is checked, then Contextual Related Posts will not automatically "
921
  "insert the related posts at the end of post content."
922
  msgstr ""
923
 
924
- #: includes/admin/modules/metabox.php:106
925
  msgid "Exclude this post from the related posts list:"
926
  msgstr ""
927
 
928
- #: includes/admin/modules/metabox.php:109
929
  msgid ""
930
  "If this is checked, then this post will be excluded from the popular posts "
931
  "list."
932
  msgstr ""
933
 
934
- #: includes/admin/modules/metabox.php:113
935
  msgid "Keyword:"
936
  msgstr ""
937
 
938
- #: includes/admin/modules/metabox.php:115
939
  msgid ""
940
  "Enter either a word or a phrase that will be used to find related posts. If "
941
  "entered, the plugin will continue to search the `post_title` and "
@@ -943,56 +876,70 @@ msgid ""
943
  "title and content of this post."
944
  msgstr ""
945
 
946
- #: includes/admin/modules/metabox.php:119
947
  msgid "Exclude terms:"
948
  msgstr ""
949
 
950
- #: includes/admin/modules/metabox.php:121
951
  msgid ""
952
  "Enter a comma-separated list of terms. If a related post's title or content "
953
  "contains any of these terms then it will be excluded from the results."
954
  msgstr ""
955
 
956
- #: includes/admin/modules/metabox.php:125
957
- #: includes/admin/modules/metabox.php:133
958
  msgid "Manual related posts:"
959
  msgstr ""
960
 
961
- #: includes/admin/modules/metabox.php:127
962
  msgid ""
963
  "Comma separated list of post, page or custom post type IDs. e.g. "
964
  "188,320,500. These will be given preference over the related posts generated "
965
  "by the plugin."
966
  msgstr ""
967
 
968
- #: includes/admin/modules/metabox.php:128
969
  msgid ""
970
  "Once you enter the list above and save this page, the plugin will display "
971
  "the titles of the posts below for your reference. Only IDs corresponding to "
972
  "published posts or custom post types will be retained."
973
  msgstr ""
974
 
975
- #: includes/admin/modules/metabox.php:144
 
976
  #, php-format
977
  msgid "This post type is: %s"
978
  msgstr ""
979
 
980
- #: includes/admin/modules/metabox.php:155
 
 
 
 
 
 
 
 
 
 
 
 
 
981
  msgid "Location of thumbnail"
982
  msgstr ""
983
 
984
- #: includes/admin/modules/metabox.php:157
985
  msgid ""
986
  "Enter the full URL to the image (JPG, PNG or GIF) you'd like to use. This "
987
  "image will be used for the post. It will be resized to the thumbnail size "
988
  "set under Settings &raquo; Related Posts &raquo; Output Options"
989
  msgstr ""
990
 
991
- #: includes/admin/modules/metabox.php:158
992
  msgid "The URL above is saved in the meta field:"
993
  msgstr ""
994
 
995
- #: includes/admin/modules/metabox.php:163
996
  msgid ""
997
  "You have Top 10 WordPress Plugin installed. If you are trying to modify the "
998
  "thumbnail, then you'll need to make the same change in the Top 10 meta box "
@@ -1025,8 +972,9 @@ msgstr ""
1025
 
1026
  #: includes/admin/modules/tools.php:75
1027
  msgid ""
1028
- "Clear the Contextual Related Posts cache. This will also be cleared "
1029
- "automatically when you save the settings page."
 
1030
  msgstr ""
1031
 
1032
  #: includes/admin/modules/tools.php:78 includes/admin/modules/tools.php:80
@@ -1168,19 +1116,23 @@ msgstr ""
1168
  msgid "Modified from default setting"
1169
  msgstr ""
1170
 
1171
- #: includes/admin/settings-page.php:694
 
 
 
 
1172
  msgctxt "tag delimiter"
1173
  msgid ","
1174
  msgstr ""
1175
 
1176
- #: includes/admin/settings-page.php:769
1177
  msgid ""
1178
  "This option cannot be changed because of the selected related posts style. "
1179
  "To modify this option, you will need to select No styles or Text only in the "
1180
  "Styles tab"
1181
  msgstr ""
1182
 
1183
- #: includes/admin/settings-page.php:773
1184
  msgid ""
1185
  "This option cannot be changed because of the selected related posts style. "
1186
  "To modify this option, you will need to select No styles in the Styles tab"
@@ -1234,7 +1186,111 @@ msgstr ""
1234
  msgid "Follow me"
1235
  msgstr ""
1236
 
1237
- #: includes/main-query.php:190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1238
  #, php-format
1239
  msgid ""
1240
  "Powered by <a href=\"%s\" rel=\"nofollow\" style=\"float:none\">Contextual "
@@ -1253,10 +1309,6 @@ msgstr ""
1253
  msgid "Post ID."
1254
  msgstr ""
1255
 
1256
- #: includes/modules/class-crp-rest-api.php:165
1257
- msgid "Number of posts"
1258
- msgstr ""
1259
-
1260
  #: includes/modules/class-crp-rest-api.php:170
1261
  msgid "Post types (comma separated)"
1262
  msgstr ""
@@ -1277,51 +1329,63 @@ msgstr ""
1277
  msgid "Taxonomy IDs from which posts are excluded (comma separated)"
1278
  msgstr ""
1279
 
 
 
 
 
1280
  #: includes/modules/class-crp-widget.php:31
1281
  msgid "Display Related Posts"
1282
  msgstr ""
1283
 
1284
- #: includes/modules/class-crp-widget.php:82
1285
  msgid "Title"
1286
  msgstr ""
1287
 
1288
- #: includes/modules/class-crp-widget.php:97
 
 
 
 
1289
  msgid " Show excerpt?"
1290
  msgstr ""
1291
 
1292
- #: includes/modules/class-crp-widget.php:102
1293
  msgid " Show author?"
1294
  msgstr ""
1295
 
1296
- #: includes/modules/class-crp-widget.php:107
1297
  msgid " Show date?"
1298
  msgstr ""
1299
 
1300
- #: includes/modules/class-crp-widget.php:113
 
 
 
 
1301
  msgid "Thumbnails inline, before title"
1302
  msgstr ""
1303
 
1304
- #: includes/modules/class-crp-widget.php:114
1305
  msgid "Thumbnails inline, after title"
1306
  msgstr ""
1307
 
1308
- #: includes/modules/class-crp-widget.php:115
1309
  msgid "Only thumbnails, no text"
1310
  msgstr ""
1311
 
1312
- #: includes/modules/class-crp-widget.php:116
1313
  msgid "No thumbnails, only text."
1314
  msgstr ""
1315
 
1316
- #: includes/modules/class-crp-widget.php:143
1317
  msgid " Randomize posts"
1318
  msgstr ""
1319
 
1320
- #: includes/modules/class-crp-widget.php:148
1321
- msgid "Only from categories"
1322
  msgstr ""
1323
 
1324
- #: includes/output-generator.php:235
1325
  msgid " by "
1326
  msgstr ""
1327
 
3
  msgstr ""
4
  "Project-Id-Version: Contextual Related Posts\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2022-04-21 15:12+0100\n"
7
  "PO-Revision-Date: \n"
8
  "Last-Translator: Ajay D'Souza\n"
9
  "Language-Team: WebberZone\n"
24
  msgid "Contextual Related Posts"
25
  msgstr ""
26
 
27
+ #: includes/admin/admin.php:32 includes/admin/default-settings.php:193
28
  #: includes/deprecated.php:147
29
  msgid "Related Posts"
30
  msgstr ""
45
  "\"%2$s\" target=\"_blank\">WordPress.org</a>"
46
  msgstr ""
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  #: includes/admin/default-settings.php:62
49
  msgid "Cache posts only"
50
  msgstr ""
77
  #, php-format
78
  msgid ""
79
  "If you choose to disable this, please add %1$s to your template file where "
80
+ "you want it displayed. On the home page and archives, the related posts are "
81
+ "added for each post. Caching is highly recommended to avoid performance "
82
+ "issues."
83
  msgstr ""
84
 
85
  #: includes/admin/default-settings.php:85
133
  msgstr ""
134
 
135
  #: includes/admin/default-settings.php:111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  msgid "Disable on mobile devices"
137
  msgstr ""
138
 
139
+ #: includes/admin/default-settings.php:112
140
  msgid ""
141
  "Disable display of related posts on mobile devices. Might not always work "
142
  "with caching plugins."
143
  msgstr ""
144
 
145
+ #: includes/admin/default-settings.php:118
146
  msgid "Disable on AMP pages"
147
  msgstr ""
148
 
149
+ #: includes/admin/default-settings.php:119
150
  msgid "Disable display of related posts on AMP pages."
151
  msgstr ""
152
 
153
+ #: includes/admin/default-settings.php:125
154
  msgid "Delete options on uninstall"
155
  msgstr ""
156
 
157
+ #: includes/admin/default-settings.php:126
158
  msgid ""
159
  "If this is checked, all settings related to Contextual Related Posts are "
160
  "removed from the database if you choose to uninstall/delete the plugin."
161
  msgstr ""
162
 
163
+ #: includes/admin/default-settings.php:132
164
  msgid "Delete FULLTEXT indices on uninstall"
165
  msgstr ""
166
 
167
+ #: includes/admin/default-settings.php:133
168
  msgid ""
169
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
170
  "are removed from the database if you choose to uninstall/delete the plugin."
171
  msgstr ""
172
 
173
+ #: includes/admin/default-settings.php:139
174
  msgid "Delete FULLTEXT indices on deactivate"
175
  msgstr ""
176
 
177
+ #: includes/admin/default-settings.php:140
178
  msgid ""
179
  "If this is checked, FULLTEXT indices generated by Contextual Related Posts "
180
  "are removed from the database if you choose to deactivate the plugin."
181
  msgstr ""
182
 
183
+ #: includes/admin/default-settings.php:146
184
  msgid "Show metabox"
185
  msgstr ""
186
 
187
+ #: includes/admin/default-settings.php:147
188
  msgid ""
189
  "This will add the Contextual Related Posts metabox on Edit Posts or Add New "
190
  "Posts screens. Also applies to Pages and Custom Post Types."
191
  msgstr ""
192
 
193
+ #: includes/admin/default-settings.php:153
194
  msgid "Limit meta box to Admins only"
195
  msgstr ""
196
 
197
+ #: includes/admin/default-settings.php:154
198
  msgid ""
199
  "If selected, the meta box will be hidden from anyone who is not an Admin. By "
200
  "default, Contributors and above will be able to see the meta box. Applies "
201
  "only if the above option is selected."
202
  msgstr ""
203
 
204
+ #: includes/admin/default-settings.php:160
205
  msgid "Link to Contextual Related Posts plugin page"
206
  msgstr ""
207
 
208
+ #: includes/admin/default-settings.php:161
209
  msgid ""
210
  "A no-follow link to the plugin homepage will be added as the last item of "
211
  "the related posts."
212
  msgstr ""
213
 
214
+ #: includes/admin/default-settings.php:190
215
  msgid "Heading of posts"
216
  msgstr ""
217
 
218
+ #: includes/admin/default-settings.php:191
219
  msgid "Displayed before the list of the posts as a master heading"
220
  msgstr ""
221
 
222
+ #: includes/admin/default-settings.php:198
223
  msgid "Show when no posts are found"
224
  msgstr ""
225
 
226
+ #: includes/admin/default-settings.php:204
227
  msgid "Blank output"
228
  msgstr ""
229
 
230
+ #: includes/admin/default-settings.php:205
231
  msgid "Display custom text"
232
  msgstr ""
233
 
234
+ #: includes/admin/default-settings.php:210
235
  msgid "Custom text"
236
  msgstr ""
237
 
238
+ #: includes/admin/default-settings.php:211
239
  msgid ""
240
  "Enter the custom text that will be displayed if the second option is "
241
  "selected above."
242
  msgstr ""
243
 
244
+ #: includes/admin/default-settings.php:213 includes/deprecated.php:149
245
  msgid "No related posts found"
246
  msgstr ""
247
 
248
+ #: includes/admin/default-settings.php:217
249
+ #: includes/admin/default-settings.php:702
250
  msgid "Show post excerpt"
251
  msgstr ""
252
 
253
+ #: includes/admin/default-settings.php:218
254
  msgid ""
255
  "If the post does not have an excerpt, the plugin will automatically create "
256
  "one containing the number of words specified in the next option."
257
  msgstr ""
258
 
259
+ #: includes/admin/default-settings.php:224
260
  msgid "Length of excerpt (in words)"
261
  msgstr ""
262
 
263
+ #: includes/admin/default-settings.php:233
264
+ #: includes/blocks/related-posts/src/edit.js:182
265
+ msgid "Show date"
266
+ msgstr ""
267
+
268
+ #: includes/admin/default-settings.php:234
269
  msgid ""
270
  "Displays the date of the post. Uses the same date format set in General "
271
  "Options."
272
  msgstr ""
273
 
274
+ #: includes/admin/default-settings.php:240
275
+ #: includes/blocks/related-posts/src/edit.js:165
276
+ msgid "Show author"
277
+ msgstr ""
278
+
279
+ #: includes/admin/default-settings.php:247
280
+ msgid "Show primary category/term"
281
+ msgstr ""
282
+
283
+ #: includes/admin/default-settings.php:248
284
+ msgid ""
285
+ "This will display the primary category/term. This is usually set via your "
286
+ "SEO plugin and will default to the first category/term returned by WordPress"
287
+ msgstr ""
288
+
289
+ #: includes/admin/default-settings.php:254
290
  msgid "Limit post title length (in characters)"
291
  msgstr ""
292
 
293
+ #: includes/admin/default-settings.php:255
294
  msgid ""
295
  "Any title longer than the number of characters set above will be cut and "
296
  "appended with an ellipsis (&hellip;)"
297
  msgstr ""
298
 
299
+ #: includes/admin/default-settings.php:263
300
  msgid "Open links in new window"
301
  msgstr ""
302
 
303
+ #: includes/admin/default-settings.php:270
304
  msgid "Add nofollow to links"
305
  msgstr ""
306
 
307
+ #: includes/admin/default-settings.php:277
308
  msgid "Exclusion settings"
309
  msgstr ""
310
 
311
+ #: includes/admin/default-settings.php:283
312
  msgid "Exclude display on these posts"
313
  msgstr ""
314
 
315
+ #: includes/admin/default-settings.php:284
316
  msgid ""
317
  "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500"
318
  msgstr ""
319
 
320
+ #: includes/admin/default-settings.php:290
321
  msgid "Exclude display on these post types"
322
  msgstr ""
323
 
324
+ #: includes/admin/default-settings.php:291
325
  msgid ""
326
  "The related posts will not display on any of the above selected post types."
327
  msgstr ""
328
 
329
+ #: includes/admin/default-settings.php:297
330
+ msgid "Exclude on Terms"
331
  msgstr ""
332
 
333
+ #: includes/admin/default-settings.php:298
334
+ #: includes/admin/default-settings.php:470
335
  msgid ""
336
+ "The field above has an autocomplete so simply start typing in the starting "
337
+ "letters and it will prompt you with options. This field requires a specific "
338
+ "format as displayed by the autocomplete."
339
  msgstr ""
340
 
341
+ #: includes/admin/default-settings.php:306
342
  msgid "HTML to display"
343
  msgstr ""
344
 
345
+ #: includes/admin/default-settings.php:312
346
  msgid "Before the list of posts"
347
  msgstr ""
348
 
349
+ #: includes/admin/default-settings.php:319
350
  msgid "After the list of posts"
351
  msgstr ""
352
 
353
+ #: includes/admin/default-settings.php:326
354
  msgid "Before each list item"
355
  msgstr ""
356
 
357
+ #: includes/admin/default-settings.php:333
358
  msgid "After each list item"
359
  msgstr ""
360
 
361
+ #: includes/admin/default-settings.php:363
362
+ #: includes/admin/default-settings.php:693
363
  msgid "Number of posts to display"
364
  msgstr ""
365
 
366
+ #: includes/admin/default-settings.php:364
367
  msgid ""
368
  "Maximum number of posts that will be displayed in the list. This option is "
369
  "used if you do not specify the number of posts in the widget or shortcodes"
370
  msgstr ""
371
 
372
+ #: includes/admin/default-settings.php:372
373
  msgid "Related posts should be newer than"
374
  msgstr ""
375
 
376
+ #: includes/admin/default-settings.php:373
377
  msgid ""
378
  "This sets the cut-off period for which posts will be displayed. e.g. setting "
379
  "it to 365 will show related posts from the last year only. Set to 0 to "
380
  "disable limiting posts by date."
381
  msgstr ""
382
 
383
+ #: includes/admin/default-settings.php:380
384
+ #: includes/blocks/related-posts/src/edit.js:230
385
+ #: includes/modules/class-crp-widget.php:128
386
  msgid "Order posts"
387
  msgstr ""
388
 
389
+ #: includes/admin/default-settings.php:388
390
+ #: includes/blocks/related-posts/src/edit.js:257
391
+ msgid "Randomize posts"
392
+ msgstr ""
393
+
394
+ #: includes/admin/default-settings.php:389
395
  msgid ""
396
  "This shuffles the selected related posts. If you select to order by date in "
397
  "the previous option, then the related posts will first be sorted by date and "
399
  "enabled."
400
  msgstr ""
401
 
402
+ #: includes/admin/default-settings.php:395
403
  msgid "Related posts based on title and content"
404
  msgstr ""
405
 
406
+ #: includes/admin/default-settings.php:396
407
  msgid ""
408
  "If unchecked, only posts titles are used. Enable the cache if enabling this "
409
  "option for better performance. Each site is different, so toggle this option "
410
  "to see which setting gives you better quality related posts."
411
  msgstr ""
412
 
413
+ #: includes/admin/default-settings.php:402
414
  msgid "Limit content to be compared"
415
  msgstr ""
416
 
417
+ #: includes/admin/default-settings.php:404
418
  #, php-format
419
  msgid ""
420
  "This sets the maximum words of the content that will be matched. Set to 0 "
421
  "for no limit. Max value: %1$s. Only applies if you activate the above option."
422
  msgstr ""
423
 
424
+ #: includes/admin/default-settings.php:412
425
+ #: includes/modules/class-crp-widget.php:151
426
  msgid "Post types to include"
427
  msgstr ""
428
 
429
+ #: includes/admin/default-settings.php:413
430
  msgid ""
431
  "At least one option should be selected above. Select which post types you "
432
  "want to include in the list of posts. This field can be overridden using a "
433
  "comma separated list of post types when using the manual display."
434
  msgstr ""
435
 
436
+ #: includes/admin/default-settings.php:419
437
  msgid "Limit to same post type"
438
  msgstr ""
439
 
440
+ #: includes/admin/default-settings.php:420
441
  msgid ""
442
  "If checked, the related posts will only be selected from the same post type "
443
  "of the current post."
444
  msgstr ""
445
 
446
+ #: includes/admin/default-settings.php:426
447
  msgid "Limit to same author"
448
  msgstr ""
449
 
450
+ #: includes/admin/default-settings.php:427
451
  msgid ""
452
  "If checked, the related posts will only be selected from the same author of "
453
  "the current post."
454
  msgstr ""
455
 
456
+ #: includes/admin/default-settings.php:433
457
+ msgid "Limit to same primary term"
458
+ msgstr ""
459
+
460
+ #: includes/admin/default-settings.php:434
461
+ msgid ""
462
+ "If enabled, then it will only select posts from the primary category/term. "
463
+ "This is usually set via your SEO plugin and will default to the first "
464
+ "category/term returned by WordPress"
465
+ msgstr ""
466
+
467
+ #: includes/admin/default-settings.php:440
468
+ msgid "Only from same"
469
+ msgstr ""
470
+
471
+ #: includes/admin/default-settings.php:441
472
+ msgid ""
473
+ "Limit the related posts only to the categories, tags, and/or taxonomies of "
474
+ "the current post."
475
+ msgstr ""
476
+
477
+ #: includes/admin/default-settings.php:447
478
+ msgid "Match all taxonomies"
479
+ msgstr ""
480
+
481
+ #: includes/admin/default-settings.php:448
482
+ msgid ""
483
+ "If enabled, then it will only select posts that match all the above selected "
484
+ "taxonomies. This can result in no related posts being found."
485
+ msgstr ""
486
+
487
+ #: includes/admin/default-settings.php:454
488
+ msgid "Number of common terms"
489
+ msgstr ""
490
+
491
+ #: includes/admin/default-settings.php:455
492
+ msgid ""
493
+ "Enter the minimum number of common terms that have to be matched before a "
494
+ "post is considered related."
495
+ msgstr ""
496
+
497
+ #: includes/admin/default-settings.php:462
498
  msgid "Post/page IDs to exclude"
499
  msgstr ""
500
 
501
+ #: includes/admin/default-settings.php:463
502
  msgid ""
503
  "Comma-separated list of post or page IDs to exclude from the list. e.g. "
504
  "188,320,500"
505
  msgstr ""
506
 
507
+ #: includes/admin/default-settings.php:469
508
+ msgid "Exclude Terms"
509
  msgstr ""
510
 
511
+ #: includes/admin/default-settings.php:478
512
+ msgid "Exclude Term Taxonomy IDs"
513
  msgstr ""
514
 
515
+ #: includes/admin/default-settings.php:479
516
  msgid ""
517
  "This is a readonly field that is automatically populated based on the above "
518
  "input when the settings are saved. These might differ from the IDs visible "
520
  "the term_taxonomy_id which is unique to this taxonomy."
521
  msgstr ""
522
 
523
+ #: includes/admin/default-settings.php:486
524
  msgid "Disable contextual matching"
525
  msgstr ""
526
 
527
+ #: includes/admin/default-settings.php:487
528
  msgid ""
529
  "Selecting this option will turn off contextual matching. This is only useful "
530
+ "if you activate the option: \"Only from same\" above. Otherwise, you will "
531
+ "end up with the same set of related posts across your site with no relevance."
 
532
  msgstr ""
533
 
534
+ #: includes/admin/default-settings.php:493
535
  msgid "Disable contextual matching ONLY on attachments and custom post types"
536
  msgstr ""
537
 
538
+ #: includes/admin/default-settings.php:494
539
  msgid ""
540
  "Applies only if the previous option is checked. Selecting this option will "
541
  "retain contextual matching for posts and pages but disable this on any "
542
  "custom post types."
543
  msgstr ""
544
 
545
+ #: includes/admin/default-settings.php:523
546
+ #: includes/admin/default-settings.php:709
547
+ #: includes/blocks/related-posts/src/edit.js:203
548
  msgid "Location of the post thumbnail"
549
  msgstr ""
550
 
551
+ #: includes/admin/default-settings.php:528
552
+ #: includes/admin/default-settings.php:714
553
  msgid "Display thumbnails inline with posts, before title"
554
  msgstr ""
555
 
556
+ #: includes/admin/default-settings.php:529
557
+ #: includes/admin/default-settings.php:715
558
  msgid "Display thumbnails inline with posts, after title"
559
  msgstr ""
560
 
561
+ #: includes/admin/default-settings.php:530
562
+ #: includes/admin/default-settings.php:716
563
  msgid "Display only thumbnails, no text"
564
  msgstr ""
565
 
566
+ #: includes/admin/default-settings.php:531
567
+ #: includes/admin/default-settings.php:717
568
  msgid "Do not display thumbnails, only text"
569
  msgstr ""
570
 
571
+ #: includes/admin/default-settings.php:536
572
  msgid "Thumbnail size"
573
  msgstr ""
574
 
575
+ #: includes/admin/default-settings.php:537
576
  msgid ""
577
  "You can choose from existing image sizes above or create a custom size. If "
578
  "you have chosen Custom size above, then enter the width, height and crop "
580
  "width and/or height below, existing images will not be automatically resized."
581
  msgstr ""
582
 
583
+ #: includes/admin/default-settings.php:539
584
  #, php-format
585
  msgid "I recommend using %1$s or %2$s to regenerate all image sizes."
586
  msgstr ""
587
 
588
+ #: includes/admin/default-settings.php:549
589
+ #: includes/admin/default-settings.php:722
590
+ #: includes/modules/class-crp-widget.php:125
591
  msgid "Thumbnail width"
592
  msgstr ""
593
 
594
+ #: includes/admin/default-settings.php:558
595
+ #: includes/admin/default-settings.php:731
596
+ #: includes/modules/class-crp-widget.php:120
597
  msgid "Thumbnail height"
598
  msgstr ""
599
 
600
+ #: includes/admin/default-settings.php:567
601
  msgid "Hard crop thumbnails"
602
  msgstr ""
603
 
604
+ #: includes/admin/default-settings.php:568
605
  msgid ""
606
  "Check this box to hard crop the thumbnails. i.e. force the width and height "
607
  "above vs. maintaining proportions."
608
  msgstr ""
609
 
610
+ #: includes/admin/default-settings.php:574
611
  msgid "Generate thumbnail sizes"
612
  msgstr ""
613
 
614
+ #: includes/admin/default-settings.php:575
615
  msgid ""
616
  "If you select this option and Custom size is selected above, the plugin will "
617
  "register the image size with WordPress to create new thumbnails. Does not "
618
  "update old images as explained above."
619
  msgstr ""
620
 
621
+ #: includes/admin/default-settings.php:581
622
  msgid "Thumbnail size attributes"
623
  msgstr ""
624
 
625
+ #: includes/admin/default-settings.php:587
626
  #, php-format
627
  msgid "Use CSS to set the width and height: e.g. %s"
628
  msgstr ""
629
 
630
+ #: includes/admin/default-settings.php:589
631
  #, php-format
632
  msgid "Use HTML attributes to set the width and height: e.g. %s"
633
  msgstr ""
634
 
635
+ #: includes/admin/default-settings.php:590
636
  msgid ""
637
  "No width or height set. You will need to use external styles to force any "
638
  "width or height of your choice."
639
  msgstr ""
640
 
641
+ #: includes/admin/default-settings.php:595
642
  msgid "Thumbnail meta field name"
643
  msgstr ""
644
 
645
+ #: includes/admin/default-settings.php:596
646
  msgid ""
647
  "The value of this field should contain the URL of the image and can be set "
648
  "in the metabox in the Edit Post screen"
649
  msgstr ""
650
 
651
+ #: includes/admin/default-settings.php:602
652
  msgid "Get first image"
653
  msgstr ""
654
 
655
+ #: includes/admin/default-settings.php:603
656
  msgid ""
657
  "The plugin will fetch the first image in the post content if this is "
658
  "enabled. This can slow down the loading of your page if the first image in "
659
  "the followed posts is large in file-size."
660
  msgstr ""
661
 
662
+ #: includes/admin/default-settings.php:609
663
  msgid "Use default thumbnail?"
664
  msgstr ""
665
 
666
+ #: includes/admin/default-settings.php:610
667
  msgid ""
668
  "If checked, when no thumbnail is found, show a default one from the URL "
669
  "below. If not checked and no thumbnail is found, no image will be shown."
670
  msgstr ""
671
 
672
+ #: includes/admin/default-settings.php:616 includes/admin/settings-page.php:763
673
  msgid "Default thumbnail"
674
  msgstr ""
675
 
676
+ #: includes/admin/default-settings.php:617
677
  msgid ""
678
  "Enter the full URL of the image that you wish to display if no thumbnail is "
679
  "found. This image will be displayed below."
680
  msgstr ""
681
 
682
+ #: includes/admin/default-settings.php:647
683
  msgid "Related Posts style"
684
  msgstr ""
685
 
686
+ #: includes/admin/default-settings.php:655
687
  msgid "Custom CSS"
688
  msgstr ""
689
 
690
+ #: includes/admin/default-settings.php:657
691
  #, php-format
692
  msgid ""
693
  "Do not include %3$sstyle%4$s tags. Check out the %1$sFAQ%2$s for available "
694
  "CSS classes to style."
695
  msgstr ""
696
 
697
+ #: includes/admin/default-settings.php:687
698
  msgid "About this tab"
699
  msgstr ""
700
 
701
+ #: includes/admin/default-settings.php:688
702
  msgid ""
703
  "Below options override the related posts settings for your blog feed. These "
704
  "only apply if you have selected to add related posts to Feeds in the General "
706
  "way to style the related posts in the feed."
707
  msgstr ""
708
 
709
+ #: includes/admin/default-settings.php:808
710
  msgid "No styles"
711
  msgstr ""
712
 
713
+ #: includes/admin/default-settings.php:809
714
  msgid "Select this option if you plan to add your own styles"
715
  msgstr ""
716
 
717
+ #: includes/admin/default-settings.php:813
718
  msgid "Text only"
719
  msgstr ""
720
 
721
+ #: includes/admin/default-settings.php:814
722
  msgid "Disable thumbnails and no longer include the default style sheet"
723
  msgstr ""
724
 
725
+ #: includes/admin/default-settings.php:818
726
  msgid "Rounded thumbnails"
727
  msgstr ""
728
 
729
+ #: includes/admin/default-settings.php:819
730
  msgid ""
731
  "Enabling this option will turn on the thumbnails. It will also turn off the "
732
  "display of the author, excerpt and date if already enabled. Disabling this "
733
  "option will not revert any settings."
734
  msgstr ""
735
 
736
+ #: includes/admin/default-settings.php:823
737
  msgid "Masonry"
738
  msgstr ""
739
 
740
+ #: includes/admin/default-settings.php:824
741
  msgid "Enables a masonry style layout similar to one made famous by Pinterest."
742
  msgstr ""
743
 
744
+ #: includes/admin/default-settings.php:828
745
  msgid "Grid"
746
  msgstr ""
747
 
748
+ #: includes/admin/default-settings.php:829
749
  msgid "Uses CSS Grid for display. Might not work on older browsers."
750
  msgstr ""
751
 
752
+ #: includes/admin/default-settings.php:833
753
  msgid "Rounded thumbnails with CSS grid"
754
  msgstr ""
755
 
756
+ #: includes/admin/default-settings.php:834
757
  msgid ""
758
  "Uses CSS grid. It will also turn off the display of the author, excerpt and "
759
  "date if already enabled. Disabling this option will not revert any settings."
760
  msgstr ""
761
 
762
+ #: includes/admin/default-settings.php:857
763
+ #: includes/blocks/related-posts/src/edit.js:240
764
  msgid "By relevance"
765
  msgstr ""
766
 
767
+ #: includes/admin/default-settings.php:858
768
+ #: includes/blocks/related-posts/src/edit.js:244
769
  msgid "Randomly"
770
  msgstr ""
771
 
772
+ #: includes/admin/default-settings.php:859
773
+ #: includes/blocks/related-posts/src/edit.js:248
774
  msgid "By date"
775
  msgstr ""
776
 
844
  msgid "Contribute"
845
  msgstr ""
846
 
847
+ #: includes/admin/modules/metabox.php:103
848
  msgid "Disable Related Posts display:"
849
  msgstr ""
850
 
851
+ #: includes/admin/modules/metabox.php:106
852
  msgid ""
853
  "If this is checked, then Contextual Related Posts will not automatically "
854
  "insert the related posts at the end of post content."
855
  msgstr ""
856
 
857
+ #: includes/admin/modules/metabox.php:110
858
  msgid "Exclude this post from the related posts list:"
859
  msgstr ""
860
 
861
+ #: includes/admin/modules/metabox.php:113
862
  msgid ""
863
  "If this is checked, then this post will be excluded from the popular posts "
864
  "list."
865
  msgstr ""
866
 
867
+ #: includes/admin/modules/metabox.php:117
868
  msgid "Keyword:"
869
  msgstr ""
870
 
871
+ #: includes/admin/modules/metabox.php:119
872
  msgid ""
873
  "Enter either a word or a phrase that will be used to find related posts. If "
874
  "entered, the plugin will continue to search the `post_title` and "
876
  "title and content of this post."
877
  msgstr ""
878
 
879
+ #: includes/admin/modules/metabox.php:123
880
  msgid "Exclude terms:"
881
  msgstr ""
882
 
883
+ #: includes/admin/modules/metabox.php:125
884
  msgid ""
885
  "Enter a comma-separated list of terms. If a related post's title or content "
886
  "contains any of these terms then it will be excluded from the results."
887
  msgstr ""
888
 
889
+ #: includes/admin/modules/metabox.php:129
890
+ #: includes/admin/modules/metabox.php:137
891
  msgid "Manual related posts:"
892
  msgstr ""
893
 
894
+ #: includes/admin/modules/metabox.php:131
895
  msgid ""
896
  "Comma separated list of post, page or custom post type IDs. e.g. "
897
  "188,320,500. These will be given preference over the related posts generated "
898
  "by the plugin."
899
  msgstr ""
900
 
901
+ #: includes/admin/modules/metabox.php:132
902
  msgid ""
903
  "Once you enter the list above and save this page, the plugin will display "
904
  "the titles of the posts below for your reference. Only IDs corresponding to "
905
  "published posts or custom post types will be retained."
906
  msgstr ""
907
 
908
+ #: includes/admin/modules/metabox.php:148
909
+ #: includes/admin/modules/metabox.php:177
910
  #, php-format
911
  msgid "This post type is: %s"
912
  msgstr ""
913
 
914
+ #: includes/admin/modules/metabox.php:159
915
+ msgid "Exclude post IDs:"
916
+ msgstr ""
917
+
918
+ #: includes/admin/modules/metabox.php:161
919
+ msgid ""
920
+ "Comma separated list of post, page or custom post type IDs. e.g. 188,320,500."
921
+ msgstr ""
922
+
923
+ #: includes/admin/modules/metabox.php:166
924
+ msgid "Excluded posts:"
925
+ msgstr ""
926
+
927
+ #: includes/admin/modules/metabox.php:188
928
  msgid "Location of thumbnail"
929
  msgstr ""
930
 
931
+ #: includes/admin/modules/metabox.php:190
932
  msgid ""
933
  "Enter the full URL to the image (JPG, PNG or GIF) you'd like to use. This "
934
  "image will be used for the post. It will be resized to the thumbnail size "
935
  "set under Settings &raquo; Related Posts &raquo; Output Options"
936
  msgstr ""
937
 
938
+ #: includes/admin/modules/metabox.php:191
939
  msgid "The URL above is saved in the meta field:"
940
  msgstr ""
941
 
942
+ #: includes/admin/modules/metabox.php:196
943
  msgid ""
944
  "You have Top 10 WordPress Plugin installed. If you are trying to modify the "
945
  "thumbnail, then you'll need to make the same change in the Top 10 meta box "
972
 
973
  #: includes/admin/modules/tools.php:75
974
  msgid ""
975
+ "Clear the Contextual Related Posts cache. Contextual Related Posts includes "
976
+ "an inbuilt cache expiry mechanism so you'll need this when you want to wipe "
977
+ "out the cache."
978
  msgstr ""
979
 
980
  #: includes/admin/modules/tools.php:78 includes/admin/modules/tools.php:80
1116
  msgid "Modified from default setting"
1117
  msgstr ""
1118
 
1119
+ #: includes/admin/settings-page.php:462
1120
+ msgid " cropped"
1121
+ msgstr ""
1122
+
1123
+ #: includes/admin/settings-page.php:707
1124
  msgctxt "tag delimiter"
1125
  msgid ","
1126
  msgstr ""
1127
 
1128
+ #: includes/admin/settings-page.php:785
1129
  msgid ""
1130
  "This option cannot be changed because of the selected related posts style. "
1131
  "To modify this option, you will need to select No styles or Text only in the "
1132
  "Styles tab"
1133
  msgstr ""
1134
 
1135
+ #: includes/admin/settings-page.php:789
1136
  msgid ""
1137
  "This option cannot be changed because of the selected related posts style. "
1138
  "To modify this option, you will need to select No styles in the Styles tab"
1186
  msgid "Follow me"
1187
  msgstr ""
1188
 
1189
+ #: includes/blocks/related-posts/src/edit.js:105
1190
+ msgid "Related Posts Settings"
1191
+ msgstr ""
1192
+
1193
+ #: includes/blocks/related-posts/src/edit.js:111
1194
+ msgid "Show heading"
1195
+ msgstr ""
1196
+
1197
+ #: includes/blocks/related-posts/src/edit.js:114
1198
+ msgid "Heading displayed"
1199
+ msgstr ""
1200
+
1201
+ #: includes/blocks/related-posts/src/edit.js:115
1202
+ msgid "No Heading displayed"
1203
+ msgstr ""
1204
+
1205
+ #: includes/blocks/related-posts/src/edit.js:125
1206
+ #: includes/modules/class-crp-rest-api.php:165
1207
+ msgid "Number of posts"
1208
+ msgstr ""
1209
+
1210
+ #: includes/blocks/related-posts/src/edit.js:129
1211
+ msgid "Maximum number of posts to display"
1212
+ msgstr ""
1213
+
1214
+ #: includes/blocks/related-posts/src/edit.js:138
1215
+ #: includes/modules/class-crp-widget.php:91
1216
+ msgid "Offset"
1217
+ msgstr ""
1218
+
1219
+ #: includes/blocks/related-posts/src/edit.js:142
1220
+ msgid "Number of posts to skip from the top"
1221
+ msgstr ""
1222
+
1223
+ #: includes/blocks/related-posts/src/edit.js:151
1224
+ msgid "Show excerpt"
1225
+ msgstr ""
1226
+
1227
+ #: includes/blocks/related-posts/src/edit.js:154
1228
+ msgid "Excerpt displayed"
1229
+ msgstr ""
1230
+
1231
+ #: includes/blocks/related-posts/src/edit.js:155
1232
+ msgid "No excerpt"
1233
+ msgstr ""
1234
+
1235
+ #: includes/blocks/related-posts/src/edit.js:169
1236
+ msgid "\"by Author Name\" displayed"
1237
+ msgstr ""
1238
+
1239
+ #: includes/blocks/related-posts/src/edit.js:172
1240
+ msgid "No author displayed"
1241
+ msgstr ""
1242
+
1243
+ #: includes/blocks/related-posts/src/edit.js:185
1244
+ msgid "Date of post displayed"
1245
+ msgstr ""
1246
+
1247
+ #: includes/blocks/related-posts/src/edit.js:187
1248
+ msgid "Date of post not displayed"
1249
+ msgstr ""
1250
+
1251
+ #: includes/blocks/related-posts/src/edit.js:199
1252
+ msgid "Thumbnail option"
1253
+ msgstr ""
1254
+
1255
+ #: includes/blocks/related-posts/src/edit.js:209
1256
+ msgid "Before title"
1257
+ msgstr ""
1258
+
1259
+ #: includes/blocks/related-posts/src/edit.js:213
1260
+ msgid "After title"
1261
+ msgstr ""
1262
+
1263
+ #: includes/blocks/related-posts/src/edit.js:217
1264
+ msgid "Only thumbnail"
1265
+ msgstr ""
1266
+
1267
+ #: includes/blocks/related-posts/src/edit.js:221
1268
+ msgid "Only text"
1269
+ msgstr ""
1270
+
1271
+ #: includes/blocks/related-posts/src/edit.js:234
1272
+ msgid "This option directly edits the query"
1273
+ msgstr ""
1274
+
1275
+ #: includes/blocks/related-posts/src/edit.js:261
1276
+ msgid "Posts are shuffled on each load"
1277
+ msgstr ""
1278
+
1279
+ #: includes/blocks/related-posts/src/edit.js:265
1280
+ msgid "Posts displayed based on above setting"
1281
+ msgstr ""
1282
+
1283
+ #: includes/blocks/related-posts/src/edit.js:277
1284
+ msgid "Other attributes"
1285
+ msgstr ""
1286
+
1287
+ #: includes/blocks/related-posts/src/edit.js:281
1288
+ msgid ""
1289
+ "Enter other attributes in a URL-style string-query. e.g. post_types=post,"
1290
+ "page&link_nofollow=1&exclude_post_ids=5,6"
1291
+ msgstr ""
1292
+
1293
+ #: includes/main-query.php:204
1294
  #, php-format
1295
  msgid ""
1296
  "Powered by <a href=\"%s\" rel=\"nofollow\" style=\"float:none\">Contextual "
1309
  msgid "Post ID."
1310
  msgstr ""
1311
 
 
 
 
 
1312
  #: includes/modules/class-crp-rest-api.php:170
1313
  msgid "Post types (comma separated)"
1314
  msgstr ""
1329
  msgid "Taxonomy IDs from which posts are excluded (comma separated)"
1330
  msgstr ""
1331
 
1332
+ #: includes/modules/class-crp-widget.php:29
1333
+ msgid "Related Posts [CRP]"
1334
+ msgstr ""
1335
+
1336
  #: includes/modules/class-crp-widget.php:31
1337
  msgid "Display Related Posts"
1338
  msgstr ""
1339
 
1340
+ #: includes/modules/class-crp-widget.php:81
1341
  msgid "Title"
1342
  msgstr ""
1343
 
1344
+ #: includes/modules/class-crp-widget.php:86
1345
+ msgid "No. of posts"
1346
+ msgstr ""
1347
+
1348
+ #: includes/modules/class-crp-widget.php:96
1349
  msgid " Show excerpt?"
1350
  msgstr ""
1351
 
1352
+ #: includes/modules/class-crp-widget.php:101
1353
  msgid " Show author?"
1354
  msgstr ""
1355
 
1356
+ #: includes/modules/class-crp-widget.php:106
1357
  msgid " Show date?"
1358
  msgstr ""
1359
 
1360
+ #: includes/modules/class-crp-widget.php:110
1361
+ msgid "Thumbnail options"
1362
+ msgstr ""
1363
+
1364
+ #: includes/modules/class-crp-widget.php:112
1365
  msgid "Thumbnails inline, before title"
1366
  msgstr ""
1367
 
1368
+ #: includes/modules/class-crp-widget.php:113
1369
  msgid "Thumbnails inline, after title"
1370
  msgstr ""
1371
 
1372
+ #: includes/modules/class-crp-widget.php:114
1373
  msgid "Only thumbnails, no text"
1374
  msgstr ""
1375
 
1376
+ #: includes/modules/class-crp-widget.php:115
1377
  msgid "No thumbnails, only text."
1378
  msgstr ""
1379
 
1380
+ #: includes/modules/class-crp-widget.php:142
1381
  msgid " Randomize posts"
1382
  msgstr ""
1383
 
1384
+ #: includes/modules/class-crp-widget.php:147
1385
+ msgid "Only from categories (comma-separated list of term taxonomy IDs)"
1386
  msgstr ""
1387
 
1388
+ #: includes/output-generator.php:239
1389
  msgid " by "
1390
  msgstr ""
1391
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.1.1
6
- Requires at least: 5.3
7
  Tested up to: 5.9
8
  Requires PHP: 7.1
9
  License: GPLv2 or later
@@ -163,6 +163,27 @@ You can insert the related posts anywhere in your post using the `[crp]` shortco
163
 
164
  == Changelog ==
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  = 3.1.1 =
167
 
168
  Release post: [https://webberzone.com/blog/contextual-related-posts-v3-1-0/](https://webberzone.com/blog/contextual-related-posts-v3-1-0/)
@@ -200,5 +221,5 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
200
 
201
  == Upgrade Notice ==
202
 
203
- = 3.1.1 =
204
- 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.2.0
6
+ Requires at least: 5.6
7
  Tested up to: 5.9
8
  Requires PHP: 7.1
9
  License: GPLv2 or later
163
 
164
  == Changelog ==
165
 
166
+ = 3.2.0 =
167
+
168
+ Release post: [https://webberzone.com/blog/contextual-related-posts-v3-2-0/](https://webberzone.com/blog/contextual-related-posts-v3-2-0/)
169
+
170
+ * New feature:
171
+ * New option to limit posts to the primary category/term. The plugin checks if either Yoast, Rank Math, The SEO Framework or SEOPress are active. If none of these are active, the plugin will pick the first category provided by `get_the_terms()`
172
+ * New option to show the primary category/term
173
+ * New option in metabox to enter a comma-separated list of post IDs to exclude from the related posts
174
+ * New filter `crp_fill_random_posts` (default:false) which can be used to fill random posts if the number of related posts is less than the limit set
175
+
176
+ * Enhancements/modifications:
177
+ * No widget is displayed if `get_crp()` is empty i.e. no related posts are found
178
+ * `post_title` and `post_content` fields are only used if *Use content* option is set
179
+ * Gutenberg block updated to the latest Blocks API
180
+ * The widget's "Only from categories" autocomplete replaced by ID list
181
+ * Wrapper `div` now always includes `crp_related` class name. Stylesheets have been updated to have more specific styles e.g. `.crp_related.crp-rounded-thumbs`
182
+ * *Exclude categories* and *Exclude on categories* renamed to *Exclude terms* and *Exclude on terms* as they now support all taxonomies and the accepted format has changed to "Term Name (taxonomy:term_taxonomy_id)"
183
+
184
+ * Bug fixes:
185
+ * Current post was incorrectly being excluded in the translation functions
186
+
187
  = 3.1.1 =
188
 
189
  Release post: [https://webberzone.com/blog/contextual-related-posts-v3-1-0/](https://webberzone.com/blog/contextual-related-posts-v3-1-0/)
221
 
222
  == Upgrade Notice ==
223
 
224
+ = 3.2.0 =
225
+ New featuers and enhancements. Please read the release post on https://webberzone.com