Changeset 2875154
- Timestamp:
- 03/06/2023 07:33:28 AM (3 years ago)
- Location:
- easy-zillow-reviews/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (3 diffs)
-
easy-zillow-reviews.php (modified) (2 diffs)
-
includes/class-easy-zillow-reviews-professional.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-zillow-reviews/trunk/README.txt
r2875132 r2875154 6 6 Tested up to: 6.1.1 7 7 Requires PHP: 5.4 8 Stable tag: 1.5. 28 Stable tag: 1.5.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 77 = 1.5.3 = 78 * Date Updated: 2023-03-06 79 * Bug Fix: Fixed bug that caused reviews to appear out of sequence (should be newest first). 80 77 81 = 1.5.2 = 78 82 * Date Updated: 2023-03-05 79 * Bug Fix: Fixed bug that caused reviews to appear out of sequence (should be newest first).80 * Updated @wordpress/scripts Gutenberg dependency package to v25.5.0 and recompiled blocks code.83 * Implemented new method to count reviews. 84 * Updated @wordpress/scripts Gutenberg dependency package to v25.5.0. 81 85 82 86 = 1.5.1 = … … 88 92 * Zillow transitioned to Bridge Interative API access. Create a Bridge API access token to get reviews. 89 93 * New Feature: Added support for Bridge Interative API access tokens. 90 * Updated @wordpress/scripts Gutenberg dependency package to v24.6.0 and recompiled blocks code.94 * Updated @wordpress/scripts Gutenberg dependency package to v24.6.0. 91 95 * Cleaned up Settings page by rewriting labels and hiding deprecated fields. 92 96 -
easy-zillow-reviews/trunk/easy-zillow-reviews.php
r2875132 r2875154 21 21 * Plugin URI: https://wordpress.org/plugins/easy-zillow-reviews/ 22 22 * Description: Display reviews from Zillow on your site. 23 * Version: 1.5. 223 * Version: 1.5.3 24 24 * Author: Aaron Bolton 25 25 * Author URI: https://www.boltonstudios.com … … 46 46 * Rename this for your plugin and update it as you release new versions. 47 47 */ 48 define( 'EASY_ZILLOW_REVIEWS_VERSION', '1.5. 2' );48 define( 'EASY_ZILLOW_REVIEWS_VERSION', '1.5.3' ); 49 49 define( 'EASY_ZILLOW_REVIEWS_BASENAME', plugin_basename( __FILE__ ) ); 50 50 /** -
easy-zillow-reviews/trunk/includes/class-easy-zillow-reviews-professional.php
r2875132 r2875154 252 252 // Count the reviews available in the API response. 253 253 $reviews_available_count = count( $zillow_reviews_data ); 254 255 // Check if the user specified the $count parameter.256 // If not, set the $count parameter equal to the number of reviews available.257 $count = isset( $count ) ? $count : $reviews_available_count;258 259 // The $count parameter should provide a subset of the reviews available.260 // Check if the user-specified $count parameter is less than the reviews available.261 // If not, set the $count parameter equal to the number of reviews available.262 $count = $count < $reviews_available_count ? $count : $reviews_available_count;263 254 264 255 // Iterate over the elements in $zillow_reviews_data. 265 for( $i = 0; $i < $ count; $i++ ){256 for( $i = 0; $i < $reviews_available_count; $i++ ){ 266 257 267 258 $review_data = $zillow_reviews_data[ $i ]; … … 284 275 ); 285 276 } 277 278 /** 279 * Sort reviews by date. 280 * 281 * Citation 282 * Title: "Heres a nicer way using ..." 283 * Author: Scott Quinlan 284 * Date: 04/15/2012 285 * Availability: https://stackoverflow.com/questions/4282413/sort-array-of-objects-by-one-property 286 */ 287 usort( $reviews, function( $a, $b ){ 288 return strtotime( $b->get_date() ) - strtotime( $a->get_date() ); 289 }); 290 291 // Check if the user specified the $count parameter. 292 // If not, set the $count parameter equal to the number of reviews available. 293 $count = isset( $count ) ? $count : $reviews_available_count; 294 295 // The $count parameter should provide a subset of the reviews available. 296 // Check if the user-specified $count parameter is less than the reviews available. 297 // If not, set the $count parameter equal to the number of reviews available. 298 $count = $count < $reviews_available_count ? $count : $reviews_available_count; 299 300 // If the $count is different than $reviews_available_count... 301 if( $count != $reviews_available_count ){ 302 303 // Create a temporary reviews array. 304 $temp_reviews = array(); 305 306 // Iterate over the elements in $reviews. 307 for( $i = 0; $i < $count; $i++ ){ 308 309 // Populate the temporary array with a subset of reviews. 310 $temp_reviews[ $i ] = $reviews[ $i ]; 311 312 } 313 314 // Update the $reviews array. 315 $reviews = $temp_reviews; 316 } 286 317 } 287 318 }
Note: See TracChangeset
for help on using the changeset viewer.