Related Posts Thumbnails Plugin for WordPress - Version 1.8.3

Version Description

  • Please upgrade immediately - Introducing filters for developers to extend Related Posts

=

Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Related Posts Thumbnails Plugin for WordPress
Version 1.8.3
Comparing to
See all releases

Code changes from version 1.8.2 to 1.8.3

Files changed (3) hide show
  1. inc/rpt-settings.php +27 -1
  2. readme.txt +7 -3
  3. related-posts-thumbnails.php +10 -3
inc/rpt-settings.php CHANGED
@@ -16,7 +16,13 @@ if ( isset( $_POST[ 'action' ] ) && ( $_POST[ 'action' ] == 'update' ) ) {
16
  update_option( 'relpoststh_single_only', sanitize_text_field( wp_unslash( $_POST[ 'relpoststh_single_only' ] ) ) );
17
  } else {
18
  update_option( 'relpoststh_single_only', '0' );
19
- }
 
 
 
 
 
 
20
 
21
  if ( isset( $_POST[ 'relpoststh_post_types' ] ) ) {
22
  update_option( 'relpoststh_post_types', array_map( 'sanitize_text_field', wp_unslash( $_POST[ 'relpoststh_post_types' ] ) ) );
@@ -206,6 +212,7 @@ $relpoststh_devmode = get_option( 'relpoststh_devmode', $this->devmod
206
  $relpoststh_categoriesall = get_option( 'relpoststh_categoriesall', $this->categories_all );
207
  $relpoststh_categories = get_option( 'relpoststh_categories' );
208
  // $relpoststh_show_date = get_option( 'relpoststh_show_date', '0' );
 
209
  $relpoststh_show_categories = get_option( 'relpoststh_show_categories', get_option( 'relpoststh_categories' ) );
210
  $relpoststh_show_categoriesall = get_option( 'relpoststh_show_categoriesall', $relpoststh_categoriesall );
211
  $onlywiththumbs = get_option( 'relpoststh_onlywiththumbs', false );
@@ -409,6 +416,25 @@ if ( $this->wp_version >= 3 ) {
409
  ?>
410
  </td>
411
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  <!-- <tr valign="top">
413
  <th scope="row">
414
  <?php // _e( 'Show date under posts', 'related-posts-thumbnails' ); ?>:
16
  update_option( 'relpoststh_single_only', sanitize_text_field( wp_unslash( $_POST[ 'relpoststh_single_only' ] ) ) );
17
  } else {
18
  update_option( 'relpoststh_single_only', '0' );
19
+ }
20
+
21
+ if ( isset( $_POST[ 'relpoststh_mobile_view' ] ) ) {
22
+ update_option( 'relpoststh_mobile_view', sanitize_text_field( wp_unslash( $_POST[ 'relpoststh_mobile_view' ] ) ) );
23
+ } else {
24
+ update_option( 'relpoststh_mobile_view', '0' );
25
+ }
26
 
27
  if ( isset( $_POST[ 'relpoststh_post_types' ] ) ) {
28
  update_option( 'relpoststh_post_types', array_map( 'sanitize_text_field', wp_unslash( $_POST[ 'relpoststh_post_types' ] ) ) );
212
  $relpoststh_categoriesall = get_option( 'relpoststh_categoriesall', $this->categories_all );
213
  $relpoststh_categories = get_option( 'relpoststh_categories' );
214
  // $relpoststh_show_date = get_option( 'relpoststh_show_date', '0' );
215
+ $relpoststh_mobile_view = get_option( 'relpoststh_mobile_view' );
216
  $relpoststh_show_categories = get_option( 'relpoststh_show_categories', get_option( 'relpoststh_categories' ) );
217
  $relpoststh_show_categoriesall = get_option( 'relpoststh_show_categoriesall', $relpoststh_categoriesall );
218
  $onlywiththumbs = get_option( 'relpoststh_onlywiththumbs', false );
416
  ?>
417
  </td>
418
  </tr>
419
+ <tr valign="top">
420
+ <th scope="row">
421
+ <?php _e( 'Mobile view', 'related-posts-thumbnails' ); ?>:
422
+ </th>
423
+ <td>
424
+ <input type="checkbox" name="relpoststh_mobile_view" id="relpoststh_mobile_view" value="1"
425
+ <?php
426
+ if ( $relpoststh_mobile_view ) {
427
+ echo 'checked="checked"';
428
+ }
429
+ ?>
430
+ />
431
+ <label for="relpoststh_mobile_view">
432
+ <?php _e( 'Hide on mobile devices', 'related-posts-thumbnails' ); ?>
433
+ </label>
434
+ <br />
435
+ </td>
436
+ </tr>
437
+
438
  <!-- <tr valign="top">
439
  <th scope="row">
440
  <?php // _e( 'Show date under posts', 'related-posts-thumbnails' ); ?>:
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: hiddenpearls, WPBrigade
3
  Donate link: https://wpbrigade.com/
4
  Tags: easy related posts, Related Posts thumbnails, Free Related Posts, related posts, similar related posts
5
  Requires at least: 3.6
6
- Tested up to: 5.2
7
- Stable tag: 1.8.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -71,11 +71,15 @@ If there are no images of the specified size in the post, or file does not exist
71
 
72
  == Upgrade Notice ==
73
 
74
- = 1.8.2 =
75
  * Please upgrade immediately - Introducing filters for developers to extend Related Posts
76
 
77
  == Changelog ==
78
 
 
 
 
 
79
  = 1.8.2 - 2019-10-16 =
80
  * New Feature : Filter for related post top text.
81
  * New Feature : Filter to prevent image size check on inner post images.
3
  Donate link: https://wpbrigade.com/
4
  Tags: easy related posts, Related Posts thumbnails, Free Related Posts, related posts, similar related posts
5
  Requires at least: 3.6
6
+ Tested up to: 5.4
7
+ Stable tag: 1.8.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
71
 
72
  == Upgrade Notice ==
73
 
74
+ = 1.8.3 =
75
  * Please upgrade immediately - Introducing filters for developers to extend Related Posts
76
 
77
  == Changelog ==
78
 
79
+ = 1.8.3 - 2020-03-21 =
80
+ * New Feature : Filter for related posts background image.
81
+ * New Feature : Add option to disable related posts on mobile.
82
+
83
  = 1.8.2 - 2019-10-16 =
84
  * New Feature : Filter for related post top text.
85
  * New Feature : Filter to prevent image size check on inner post images.
related-posts-thumbnails.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: WordPress Related Posts Thumbnails
4
  * Plugin URI: https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=plugin-uri&utm_campaign=pro-upgrade-rp
5
  * Description: Showing related posts thumbnails under the posts.
6
- * Version: 1.8.2
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/?utm_source=related-posts-lite&utm_medium=author-link&utm_campaign=pro-upgrade-rp
9
  */
10
 
11
  /*
12
- Copyright 2010 - 2019
13
 
14
  This product was first developed by Maria I Shaldybina and later on maintained and developed by Adnan (WPBrigade.com)
15
 
@@ -73,6 +73,11 @@ class RelatedPostsThumbnails {
73
  return;
74
  }
75
 
 
 
 
 
 
76
  add_filter( 'the_content', array(
77
  $this,
78
  'auto_show'
@@ -828,9 +833,11 @@ class RelatedPostsThumbnails {
828
  $output .= '><span class="rpth_list_content">' . $title . $excerpt . '</span>' . $after_content . '</a></li>';
829
  }
830
  } else {
 
 
831
  $output .= '<a class="relpost-block-single" href="' . get_permalink( $post->ID ) . '">';
832
  $output .= '<div style="width: ' . $width . 'px; height: ' . ( $height + $text_height ) . 'px;">';
833
- $output .= '<div class="relpost-block-single-image" alt="' . $alt . '" style=" background: transparent url(' . esc_url( $url ) . ') no-repeat scroll 0% 0%; width: ' . $width . 'px; height: ' . $height . 'px; "></div>';
834
  $output .= '<div class="relpost-block-single-text" style="font-family: ' . $fontface . '; font-size: ' . get_option( 'relpoststh_fontsize', $this->font_size ) . 'px; color: ' . get_option( 'relpoststh_fontcolor', $this->font_color ) . ';">' . $title . $excerpt . '</div>';
835
  $output .= $after_content;
836
  // $output .= $date;
3
  * Plugin Name: WordPress Related Posts Thumbnails
4
  * Plugin URI: https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=related-posts-lite&utm_medium=plugin-uri&utm_campaign=pro-upgrade-rp
5
  * Description: Showing related posts thumbnails under the posts.
6
+ * Version: 1.8.3
7
  * Author: WPBrigade
8
  * Author URI: https://WPBrigade.com/?utm_source=related-posts-lite&utm_medium=author-link&utm_campaign=pro-upgrade-rp
9
  */
10
 
11
  /*
12
+ Copyright 2010 - 2020
13
 
14
  This product was first developed by Maria I Shaldybina and later on maintained and developed by Adnan (WPBrigade.com)
15
 
73
  return;
74
  }
75
 
76
+ // Disable related posts on mobile view.
77
+ if ( wp_is_mobile() && '1' == get_option( 'relpoststh_mobile_view', '0' ) ) {
78
+ return;
79
+ }
80
+
81
  add_filter( 'the_content', array(
82
  $this,
83
  'auto_show'
833
  $output .= '><span class="rpth_list_content">' . $title . $excerpt . '</span>' . $after_content . '</a></li>';
834
  }
835
  } else {
836
+ $rpt_single_background = apply_filters( 'rpt-single-background', 'background: transparent url(' . esc_url( $url ) . ') no-repeat scroll 0% 0%; width: ' . $width . 'px; height: ' . $height . 'px;' );
837
+
838
  $output .= '<a class="relpost-block-single" href="' . get_permalink( $post->ID ) . '">';
839
  $output .= '<div style="width: ' . $width . 'px; height: ' . ( $height + $text_height ) . 'px;">';
840
+ $output .= '<div class="relpost-block-single-image" alt="' . $alt . '" style="'. $rpt_single_background . '"></div>';
841
  $output .= '<div class="relpost-block-single-text" style="font-family: ' . $fontface . '; font-size: ' . get_option( 'relpoststh_fontsize', $this->font_size ) . 'px; color: ' . get_option( 'relpoststh_fontcolor', $this->font_color ) . ';">' . $title . $excerpt . '</div>';
842
  $output .= $after_content;
843
  // $output .= $date;