Ticket #22729: 22729.patch
| File 22729.patch, 2.6 KB (added by guymaliar, 6 months ago) |
|---|
-
default-widgets.php
451 451 $c = ! empty( $instance['count'] ) ? '1' : '0'; 452 452 $h = ! empty( $instance['hierarchical'] ) ? '1' : '0'; 453 453 $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; 454 $e = ! empty( $instance['hide_empty'] ) ? '1' : '0'; 454 455 455 456 echo $before_widget; 456 457 if ( $title ) 457 458 echo $before_title . $title . $after_title; 458 459 459 $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h );460 $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h, 'hide_empty' => $e); 460 461 461 462 if ( $d ) { 462 463 $cat_args['show_option_none'] = __('Select Category'); … … 496 497 $instance['count'] = !empty($new_instance['count']) ? 1 : 0; 497 498 $instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0; 498 499 $instance['dropdown'] = !empty($new_instance['dropdown']) ? 1 : 0; 500 $instance['hide_empty'] = !empty($new_instance['hide_empty']) ? 1 : 0; 499 501 500 502 return $instance; 501 503 } … … 507 509 $count = isset($instance['count']) ? (bool) $instance['count'] :false; 508 510 $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false; 509 511 $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false; 512 $hide_empty = isset( $instance['hide_empty'] ) ? (bool) $instance['hide_empty'] : false; 510 513 ?> 511 514 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label> 512 515 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p> … … 518 521 <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br /> 519 522 520 523 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> /> 521 <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label></p> 524 <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show hierarchy' ); ?></label><br /> 525 526 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hide_empty'); ?>" name="<?php echo $this->get_field_name('hide_empty'); ?>"<?php checked( $hide_empty ); ?> /> 527 <label for="<?php echo $this->get_field_id('hide_empty'); ?>"><?php _e( 'Hide empty categories' ); ?></label></p> 522 528 <?php 523 529 } 524 530
