Changeset 715558
- Timestamp:
- 05/20/2013 11:20:08 AM (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
r692631 r715558 27 27 $display_empty_categories = $instance['display_empty_categories']; 28 28 $showcount_value = $instance['showcount_value']; 29 29 $show_format= $instance['show_format']; 30 30 31 31 // Get the existing categories and build a simple select dropdown for the user. … … 54 54 <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> 55 55 <br> 56 <p><?php _e('Show? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('show_format'); ?>" type="radio" value="0" <?php if(attribute_escape($show_format)==0) echo "checked"; ?> />List <input name="<?php echo $this->get_field_name('show_format'); ?>" type="radio" value="2" <?php if(attribute_escape($show_format)==2) echo "checked"; ?>/>Drop Down </p> 57 <br> 56 58 <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> 57 59 <p><?php _e('Display Number of posts near categories? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('showcount_value'); ?>" type="radio" value="1" <?php if(attribute_escape($showcount_value)==1) echo "checked"; ?> />Yes <input name="<?php echo $this->get_field_name('showcount_value'); ?>" type="radio" value="0" <?php if(attribute_escape($showcount_value)==0) echo "checked"; ?>/>No </p> … … 70 72 $instance['display_empty_categories'] = $new_instance['display_empty_categories']; 71 73 $instance['showcount_value'] = $new_instance['showcount_value']; 74 $instance['show_format'] = $new_instance['show_format']; 72 75 73 76 … … 85 88 $display_empty_categories = $instance['display_empty_categories']; 86 89 $showcount_value = $instance['showcount_value']; 90 $show_format = $instance['show_format']; 87 91 88 92 … … 94 98 if ($yourcat) echo '<h2>' . $yourcat->name . '</h2>'; 95 99 } 100 if($instance['show_format']==0) 101 { 96 102 echo "<ul>"; 97 103 wp_list_categories('orderby=name&show_count='.$showcount_value.'&child_of='.$cat_id.'&hide_empty='.$display_empty_categories.'&title_li=&number='.$dcw_limit); 98 echo "</ul>"; 99 104 echo "</ul>"; 105 } 106 if($instance['show_format']==2) 107 { 108 ?> 109 <form action="<?php bloginfo('url'); ?>" method="get"> 110 <div> 111 <?php wp_dropdown_categories('orderby=name&show_count='.$showcount_value.'&child_of='.$cat_id.'&hide_empty='.$display_empty_categories.'&title_li=&number='.$dcw_limit); ?> 112 <input type="submit" name="submit" value="View" /> 113 </div> 114 </form> 115 116 <? 117 } 100 118 echo $after_widget; 101 119 } -
display-categories-widget/trunk/readme.txt
r692631 r715558 42 42 == Changelog == 43 43 44 = 1.0.6 = 45 * Optional display for Dropdown or List view of categories 46 47 44 48 = 1.0.5 = 45 49 * Display Number of post in each categories
Note: See TracChangeset
for help on using the changeset viewer.