Changeset 972684
- Timestamp:
- 08/25/2014 10:07:56 PM (12 years ago)
- Location:
- proper-widgets/trunk
- Files:
-
- 3 edited
-
proper-widgets.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
the-widgets/proper-posts-widget.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
proper-widgets/trunk/proper-widgets.php
r969970 r972684 5 5 Plugin URI: http://theproperweb.com/product/proper-widgets/ 6 6 Description: More widgets than you can shake a stick at. 7 Version: 1.0. 07 Version: 1.0.1 8 8 Author: PROPER Web Development 9 9 Author URI: http://theproperweb.com … … 13 13 14 14 // Constants 15 define( 'PROPER_WIDGETS_VERSION', '1.0. 0' );15 define( 'PROPER_WIDGETS_VERSION', '1.0.1' ); 16 16 define( 'PROPER_WIDGETS_MINIMUM_WP_VERSION', '3.0' ); 17 17 define( 'PROPER_WIDGETS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
proper-widgets/trunk/readme.txt
r969972 r972684 5 5 Requires at least: 3.0 6 6 Tested up to: 4.0 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 9 9 Creates easy-to-use, helpful widgets … … 43 43 == Changelog == 44 44 45 = 1.0.1 = 46 * Fixed issue with Posts widget in PHP 5.2 47 45 48 = 1.0.0 = 46 49 * Added the Author widget -
proper-widgets/trunk/the-widgets/proper-posts-widget.php
r969970 r972684 143 143 switch ( $instance['orderby_final'] ) { 144 144 case 'date': 145 usort( $the_posts, function ($a, $b) { 146 return $a->post_date < $b->post_date; 147 }); 148 break; 145 usort( $the_posts, array( $this, 'usort_published' ) ); 146 break; 147 149 148 case 'modified': 150 usort( $the_posts, function ( $a, $b ) { 151 return $a->post_modified < $b->post_modified; 152 } ); 153 break; 149 usort( $the_posts, array( $this, 'usort_modified' ) ); 150 break; 151 152 case 'title': 153 usort( $the_posts, array( $this, 'usort_title' ) ); 154 break; 155 156 case 'comment_count': 157 usort( $the_posts, array( $this, 'usort_comments' ) ); 158 break; 159 154 160 case 'rand': 155 161 shuffle( $the_posts ); 156 break;157 case 'title':158 usort( $the_posts, function ($a, $b) {159 return strcmp( $a->post_title, $b->post_title );160 });161 break;162 case 'comment_count':163 usort( $the_posts, function ( $a, $b ) {164 return $a->comment_count > $b->comment_count;165 } );166 162 break; 167 163 } … … 263 259 264 260 } 261 262 /** 263 * Sorting functions used by usort 264 */ 265 private function usort_published ( $a, $b ) { 266 return $a->post_date < $b->post_date; 267 } 268 269 private function usort_modified ( $a, $b ) { 270 return $a->post_modified < $b->post_modified; 271 } 272 273 private function usort_title ( $a, $b ) { 274 return strcmp( $a->post_title, $b->post_title ); 275 } 276 277 private function usort_comments ( $a, $b ) { 278 return $a->comment_count > $b->comment_count; 279 } 265 280 } 266 281
Note: See TracChangeset
for help on using the changeset viewer.