Changeset 685394
- Timestamp:
- 03/21/2013 10:41:09 PM (13 years ago)
- Location:
- display-categories-widget/trunk
- Files:
-
- 2 edited
-
display_categories_widget.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
display-categories-widget/trunk/display_categories_widget.php
r651637 r685394 25 25 $dcw_limit = $instance['dcw_limit']; 26 26 $display_parent = $instance['display_parent']; 27 $display_empty_categories = $instance['display_empty_categories']; 28 27 29 28 30 // Get the existing categories and build a simple select dropdown for the user. … … 49 51 </p> 50 52 <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 <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 <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 <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> 52 56 <?php 53 57 } … … 60 64 $instance['dcw_limit'] = $new_instance['dcw_limit']; 61 65 $instance['display_parent'] = $new_instance['display_parent']; 66 $instance['display_empty_categories'] = $new_instance['display_empty_categories']; 67 62 68 63 69 return $instance; … … 72 78 $cat_id = $instance['category']; 73 79 $dcw_limit = $instance['dcw_limit']; 80 $display_empty_categories = $instance['display_empty_categories']; 81 74 82 75 83 if (!empty($title)) … … 81 89 } 82 90 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); 84 92 echo "</ul>"; 85 93 -
display-categories-widget/trunk/readme.txt
r651867 r685394 42 42 == Changelog == 43 43 44 = 1.0.4 = 45 * Display Empty categories Option 46 44 47 = 1.0.3 = 45 48 * Display parent category show/hide option
Note: See TracChangeset
for help on using the changeset viewer.