From 7543aa2d1798762c9885c8d98991b6979605a17b Mon Sep 17 00:00:00 2001 From: Ajay DSouza Date: Sun, 5 Jun 2016 23:27:39 +0100 Subject: [PATCH] Version 2.0.1 --- readme.txt | 4 ++++ where-did-they-go-from-here.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 9cd96c5..bb398ba 100644 --- a/readme.txt +++ b/readme.txt @@ -107,6 +107,10 @@ This function takes an array of options similar to the shortcode above. == Changelog == += 2.0.1 = +* Fixed: + * Limit for number of posts broke in v2.0.0 + = 2.0.0 = * Features: * Multisite activation and uninstall diff --git a/where-did-they-go-from-here.php b/where-did-they-go-from-here.php index 0320a15..39d4693 100644 --- a/where-did-they-go-from-here.php +++ b/where-did-they-go-from-here.php @@ -14,7 +14,7 @@ * Plugin Name: Where did they go from here * Plugin URI: http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/ * Description: The best way to display posts followed by users a.k.a. "Readers who viewed this page, also viewed" links - * Version: 2.0.0 + * Version: 2.0.1 * Author: Ajay D'Souza * Author URI: https://ajaydsouza.com * License: GPL-2.0+ @@ -186,7 +186,7 @@ function get_wherego( $args = array() ) { foreach ( $results as $result ) { - if ( 0 === $result ) { + if ( 0 === (int) $result ) { break; } @@ -220,7 +220,7 @@ function get_wherego( $args = array() ) { $loop_counter++; } - if ( $loop_counter === $args['limit'] ) { + if ( $loop_counter === (int) $args['limit'] ) { break; // End loop when related posts limit is reached. } } // End of foreach loop.