Related Posts for WordPress - Version 1.2.2

Version Description

: August 16, 2014 = * Solved a conflict with the NextGen plugin (apply_filters recursion on same filter kills underlying call). * Excerpt length is now set in words instead of characters. * Small default CSS tweaks.

Download this release

Release Info

Developer barrykooij
Plugin Icon 128x128 Related Posts for WordPress
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.2

assets/css/settings.css CHANGED
@@ -1 +1 @@
1
- .rp4wp-content{width:65%;float:left;box-sizing:border-box}.rp4wp-content textarea{width:50%;height:150px}.rp4wp-content .rp4wp-description{display:block;margin:5px 0;line-height:1.4em;color:#666;font-style:italic}.rp4wp-sidebar{width:33%;margin-left:2%;padding:0 0 0 2%;border-left:1px solid #ccc;float:left;box-sizing:border-box}.rp4wp-sidebar .rp4wp-box{margin-bottom:20px}.rp4wp-sidebar .rp4wp-box .rp4wp-sidebar-header{line-height:0;border-bottom:2px solid #005592}
1
+ .rp4wp-content{width:65%;float:left;box-sizing:border-box}.rp4wp-content input.rp4wp-input-text{width:100%}.rp4wp-content textarea{width:100%;height:150px}.rp4wp-content .rp4wp-description{display:block;margin:5px 0;line-height:1.4em;color:#666;font-style:italic}.rp4wp-sidebar{width:33%;margin-left:2%;padding:0 0 0 2%;border-left:1px solid #ccc;float:left;box-sizing:border-box}.rp4wp-sidebar .rp4wp-box{margin-bottom:20px}.rp4wp-sidebar .rp4wp-box .rp4wp-sidebar-header{line-height:0;border-bottom:2px solid #005592}
assets/css/settings.less CHANGED
@@ -3,8 +3,12 @@
3
  float: left;
4
  box-sizing: border-box;
5
 
 
 
 
 
6
  textarea {
7
- width: 50%;
8
  height: 150px;
9
  }
10
 
3
  float: left;
4
  box-sizing: border-box;
5
 
6
+ input.rp4wp-input-text {
7
+ width: 100%;
8
+ }
9
+
10
  textarea {
11
+ width: 100%;
12
  height: 150px;
13
  }
14
 
classes/class-settings.php CHANGED
@@ -26,7 +26,7 @@ class RP4WP_Settings {
26
  // CSS default
27
  $css_default_lines = array();
28
  $css_default_lines[] = '.rp4wp-related-posts ul {width:100%padding:0;margin:0;float:left;}';
29
- $css_default_lines[] = '.rp4wp-related-posts li{list-style:none;padding-bottom:20px}';
30
  $css_default_lines[] = '.rp4wp-related-posts li p {margin:0;padding:0}';
31
  $css_default_lines[] = '.rp4wp-related-post-image{width:35%;padding-right:25px;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;float:left;}';
32
 
@@ -66,10 +66,10 @@ class RP4WP_Settings {
66
  ),
67
  array(
68
  'id' => 'excerpt_length',
69
- 'label' => __( 'Exceprt length', 'related-posts-for-wp' ),
70
- 'description' => __( 'The amount of characters to be displayed below the title on website. To disable, set value to 0.', 'related-posts-for-wp' ),
71
  'type' => 'text',
72
- 'default' => '25',
73
  ),
74
  array(
75
  'id' => 'display_image',
@@ -171,7 +171,7 @@ class RP4WP_Settings {
171
  echo '<input type="checkbox" name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '" value="1" ' . checked( 1, $this->get_option( $field['id'] ), false ) . ' />';
172
  break;
173
  case 'text':
174
- echo '<input type="text" name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '" value="' . $this->get_option( $field['id'] ) . '" />';
175
  break;
176
  case 'textarea':
177
  echo '<textarea name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '">' . $this->get_option( $field['id'] ) . '</textarea>';
26
  // CSS default
27
  $css_default_lines = array();
28
  $css_default_lines[] = '.rp4wp-related-posts ul {width:100%padding:0;margin:0;float:left;}';
29
+ $css_default_lines[] = '.rp4wp-related-posts li{list-style:none;padding:0;margin:0;padding-bottom:20px;}';
30
  $css_default_lines[] = '.rp4wp-related-posts li p {margin:0;padding:0}';
31
  $css_default_lines[] = '.rp4wp-related-post-image{width:35%;padding-right:25px;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;float:left;}';
32
 
66
  ),
67
  array(
68
  'id' => 'excerpt_length',
69
+ 'label' => __( 'Excerpt length', 'related-posts-for-wp' ),
70
+ 'description' => __( 'The amount of words to be displayed below the title on website. To disable, set value to 0.', 'related-posts-for-wp' ),
71
  'type' => 'text',
72
+ 'default' => '15',
73
  ),
74
  array(
75
  'id' => 'display_image',
171
  echo '<input type="checkbox" name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '" value="1" ' . checked( 1, $this->get_option( $field['id'] ), false ) . ' />';
172
  break;
173
  case 'text':
174
+ echo '<input type="text" name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '" value="' . $this->get_option( $field['id'] ) . '" class="rp4wp-input-text" />';
175
  break;
176
  case 'textarea':
177
  echo '<textarea name="' . self::PAGE . '[' . $field['id'] . ']' . '" id="' . $field['id'] . '">' . $this->get_option( $field['id'] ) . '</textarea>';
classes/filters/class-filter-after-post.php CHANGED
@@ -56,6 +56,7 @@ class RP4WP_Filter_After_Post extends RP4WP_Filter {
56
  // Open the list
57
  $content .= "<ul>\n";
58
 
 
59
  foreach ( $related_posts as $rp4wp_post ) {
60
 
61
  // Setup the postdata
@@ -87,7 +88,7 @@ class RP4WP_Filter_After_Post extends RP4WP_Filter {
87
 
88
  $excerpt_length = RP4WP::get()->settings->get_option( 'excerpt_length' );
89
  if ( $excerpt_length > 0 ) {
90
- $excerpt = substr( get_the_excerpt(), 0, $excerpt_length );
91
  $content .= "<p>" . $excerpt . "</p>";
92
  }
93
 
56
  // Open the list
57
  $content .= "<ul>\n";
58
 
59
+
60
  foreach ( $related_posts as $rp4wp_post ) {
61
 
62
  // Setup the postdata
88
 
89
  $excerpt_length = RP4WP::get()->settings->get_option( 'excerpt_length' );
90
  if ( $excerpt_length > 0 ) {
91
+ $excerpt = ( ( '' != $rp4wp_post->post_excerpt ) ? $rp4wp_post->post_excerpt : wp_trim_words( $rp4wp_post->post_content, $excerpt_length ) );
92
  $content .= "<p>" . $excerpt . "</p>";
93
  }
94
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.barrykooij.com/
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo
5
  Requires at least: 3.6
6
  Tested up to: 3.9.2
7
- Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -73,6 +73,11 @@ There is one custom table created for the post cache, this table will however no
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
76
  = 1.2.1 : August 14, 2014 =
77
  * Fixed a small CSS default rule.
78
 
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo
5
  Requires at least: 3.6
6
  Tested up to: 3.9.2
7
+ Stable tag: 1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
73
 
74
  == Changelog ==
75
 
76
+ = 1.2.2 : August 16, 2014 =
77
+ * Solved a conflict with the NextGen plugin (apply_filters recursion on same filter kills underlying call).
78
+ * Excerpt length is now set in words instead of characters.
79
+ * Small default CSS tweaks.
80
+
81
  = 1.2.1 : August 14, 2014 =
82
  * Fixed a small CSS default rule.
83
 
related-posts-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.barrykooij.com/
5
  Description: Related Posts for WordPress, related posts that perform!
6
- Version: 1.2.1
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
@@ -26,7 +26,7 @@ class RP4WP {
26
 
27
  private static $instance = null;
28
 
29
- const VERSION = '1.2.1';
30
 
31
  /**
32
  * @var RP4WP_Settings
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.barrykooij.com/
5
  Description: Related Posts for WordPress, related posts that perform!
6
+ Version: 1.2.2
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
26
 
27
  private static $instance = null;
28
 
29
+ const VERSION = '1.2.2';
30
 
31
  /**
32
  * @var RP4WP_Settings