Plugin Directory

Changeset 685394


Ignore:
Timestamp:
03/21/2013 10:41:09 PM (13 years ago)
Author:
iteamweb
Message:

empty categories display

Location:
display-categories-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • display-categories-widget/trunk/display_categories_widget.php

    r651637 r685394  
    2525    $dcw_limit = $instance['dcw_limit'];
    2626    $display_parent = $instance['display_parent'];
     27    $display_empty_categories = $instance['display_empty_categories'];
     28   
    2729
    2830       // Get the existing categories and build a simple select dropdown for the user.
     
    4951            </p>
    5052<p><label for="<?php echo $this->get_field_id('dcw_limit'); ?>"><?php _e('Limit (optional):'); ?> <input class="widefat" id="<?php echo $this->get_field_id('dcw_limit'); ?>" name="<?php echo $this->get_field_name('dcw_limit'); ?>" type="text" value="<?php echo attribute_escape($dcw_limit); ?>" /></label></p>
    51 <p><?php _e('Display Parent? (optional):'); ?> <input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="1" <?php if(attribute_escape($display_parent)==1) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="0"  <?php if(attribute_escape($display_parent)==0) echo "checked"; ?>/>No </p>
     53<p><?php _e('Display Parent? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="1" <?php if(attribute_escape($display_parent)==1) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="0"  <?php if(attribute_escape($display_parent)==0) echo "checked"; ?>/>No </p>
     54<br>
     55<p><?php _e('Display Empty categories? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('display_empty_categories'); ?>" type="radio" value="0" <?php if(attribute_escape($display_empty_categories)==0) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('display_empty_categories'); ?>" type="radio" value="1"  <?php if(attribute_escape($display_empty_categories)==1) echo "checked"; ?>/>No </p>
    5256  <?php
    5357  }
     
    6064    $instance['dcw_limit'] = $new_instance['dcw_limit'];
    6165    $instance['display_parent'] = $new_instance['display_parent'];
     66    $instance['display_empty_categories'] = $new_instance['display_empty_categories'];
     67   
    6268   
    6369    return $instance;
     
    7278    $cat_id = $instance['category'];
    7379    $dcw_limit = $instance['dcw_limit'];
     80    $display_empty_categories = $instance['display_empty_categories'];
     81   
    7482 
    7583    if (!empty($title))
     
    8189      }
    8290    echo "<ul>";
    83     wp_list_categories('orderby=name&child_of='.$cat_id.'&hide_empty=0&title_li=&number='.$dcw_limit);
     91    wp_list_categories('orderby=name&child_of='.$cat_id.'&hide_empty='.$display_empty_categories.'&title_li=&number='.$dcw_limit);
    8492    echo "</ul>";
    8593 
  • display-categories-widget/trunk/readme.txt

    r651867 r685394  
    4242== Changelog ==
    4343
     44= 1.0.4 =
     45* Display Empty categories Option
     46
    4447= 1.0.3 =
    4548* Display parent category show/hide option
Note: See TracChangeset for help on using the changeset viewer.