Changeset 3071992
- Timestamp:
- 04/16/2024 11:01:59 PM (4 months ago)
- Location:
- list-custom-taxonomy-widget
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
list-custom-taxonomy-widget/trunk/list-custom-taxonomy-widget.php
r1603696 r3071992 4 4 * Plugin URI: http://celloexpressions.com/plugins/list-custom-taxonomy-widget 5 5 * Description: Widget that displays category listings for custom post types (custom taxonomies). 6 * Version: 4. 16 * Version: 4. 7 7 * Author: Nick Halsey 8 8 * Author URI: http://celloexpressions.com/ … … 12 12 13 13 ===================================================================================== 14 Copyright (C) 20 17Nick Halsey14 Copyright (C) 20 Nick Halsey 15 15 16 16 This program is free software; you can redistribute it and/or … … 60 60 $this_taxonomy = ''; 61 61 } 62 $hierarchical = !empty( $instance['hierarchical'] ) ? '1' : '0';62 $hierarchical = !empty( $instance['hierarchical'] ) ? ; 63 63 $inv_empty = !empty( $instance['empty'] ) ? '0' : '1'; // invert to go from UI's "show empty" to WP's "hide empty" 64 64 $showcount = !empty( $instance['count'] ) ? '1' : '0'; … … 99 99 } 100 100 // Output 101 $tax = $this_taxonomy;101 $tax = ; 102 102 echo $before_widget; 103 103 echo '<div id="lct-widget-'.$tax.'-container" class="list-custom-taxonomy-widget">'; 104 if ( $title ) echo $before_title . $title. $after_title;104 if ( $title ) echo $before_title . . $after_title; 105 105 if($dropdown){ 106 106 $taxonomy_object = get_taxonomy( $tax ); … … 130 130 'walker' => $walker, 131 131 ); 132 echo '<form action="'. get_bloginfo('url'). '" method="get">';133 wp_dropdown_categories( $args);132 echo '<form action="'. . '" method="get">'; 133 wp_dropdown_categories(); 134 134 $dropdown_submit_text = apply_filters( 'list_custom_taxonomy_widget_dropdown_submit_text', __( 'go »', 'list-custom-taxonomy-widget' ) ); 135 135 echo '<input type="submit" value"' . esc_attr( $dropdown_submit_text ) . '" /></form>'; … … 163 163 ); 164 164 echo '<ul id="lct-widget-'.$tax.'">'; 165 wp_list_categories( $args);165 wp_list_categories(); 166 166 echo '</ul>'; 167 167 } … … 173 173 $instance = $old_instance; 174 174 175 $instance['title'] = s trip_tags( $new_instance['title'] );176 $instance['taxonomy'] = s trip_tags( $new_instance['taxonomy'] );177 $instance['orderby'] = $new_instance['orderby'];178 $instance['ascdsc'] = $new_instance['ascdsc'];179 $instance['exclude'] = $new_instance['exclude'];180 $instance['expandoptions'] = $new_instance['expandoptions'];181 $instance['childof'] = $new_instance['childof'];175 $instance['title'] = s( $new_instance['title'] ); 176 $instance['taxonomy'] = s( $new_instance['taxonomy'] ); 177 $instance['orderby'] = ; 178 $instance['ascdsc'] = ; 179 $instance['exclude'] = ; 180 $instance['expandoptions'] = ; 181 $instance['childof'] = ; 182 182 $instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0; 183 183 $instance['empty'] = !empty($new_instance['empty']) ? 1 : 0; … … 192 192 **/ 193 193 function form( $instance ) { 194 //for showing/hiding advanced options; wordpress moves this script to where it needs to go195 wp_enqueue_script('jquery');196 ?><script>197 jQuery(document).ready(function(){198 var status = jQuery('#<?php echo $this->get_field_id('expandoptions'); ?>').val();199 if ( status === 'expand' ) {200 jQuery('.lctw-expand-options').hide();201 jQuery('.lctw-all-options').show();202 } else {203 jQuery('.lctw-all-options').hide();204 }205 });206 function lctwExpand(id){207 jQuery('#' + id).val('expand');208 jQuery('.lctw-all-options').show(500);209 jQuery('.lctw-expand-options').hide(500);210 }211 function lctwContract(id){212 jQuery('#' + id).val('contract');213 jQuery('.lctw-all-options').hide(500);214 jQuery('.lctw-expand-options').show(500);215 }216 </script><?php217 194 // instance exist? if not set defaults 218 195 if ( $instance ) { … … 242 219 $dropdown = false; 243 220 } 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 244 245 245 // The widget form ?> 246 246 <p> 247 247 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'list-custom-taxonomy-widget' ); ?></label> 248 <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" class="widefat" />248 <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo ; ?>" class="widefat" /> 249 249 </p> 250 250 <p> … … 267 267 </select> 268 268 </p> 269 <h4 class="lctw-expand-options" ><a href="javascript:void(0)" onclick="lctwExpand('<?php echo $this->get_field_id('expandoptions'); ?>')" ><?php _e( 'More Options…', 'list-custom-taxonomy-widget' ); ?></a></h4>270 <div class="lctw-all-options" >269 <h4 class="lctw-expand-options"><a href="javascript:void(0)" onclick="lctwExpand('<?php echo $this->get_field_id('expandoptions'); ?>')" ><?php _e( 'More Options…', 'list-custom-taxonomy-widget' ); ?></a></h4> 270 <div class="lctw-all-options"> 271 271 <h4 class="lctw-contract-options"><a href="javascript:void(0)" onclick="lctwContract('<?php echo $this->get_field_id('expandoptions'); ?>')" ><?php _e( 'Hide Extended Options', 'list-custom-taxonomy-widget' ); ?></a></h4> 272 272 <input type="hidden" value="<?php echo $expandoptions; ?>" id="<?php echo $this->get_field_id('expandoptions'); ?>" name="<?php echo $this->get_field_name('expandoptions'); ?>" /> … … 295 295 <p> 296 296 <label for="<?php echo $this->get_field_id('exclude'); ?>">Exclude (comma-separated list of ids to exclude)</label><br/> 297 <input type="text" class="widefat" name="<?php echo $this->get_field_name('exclude'); ?>" value="<?php echo $exclude; ?>" />297 <input type="text" class="widefat" name="<?php echo $this->get_field_name('exclude'); ?>" value="<?php echo ; ?>" /> 298 298 </p> 299 299 <p> 300 300 <label for="<?php echo $this->get_field_id('exclude'); ?>">Only Show Children of (category id)</label><br/> 301 <input type="text" class="widefat" name="<?php echo $this->get_field_name('childof'); ?>" value="<?php echo $childof; ?>" />301 <input type="text" class="widefat" name="<?php echo $this->get_field_name('childof'); ?>" value="<?php echo ; ?>" /> 302 302 </p> 303 303 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> /> -
list-custom-taxonomy-widget/trunk/readme.txt
r2968084 r3071992 3 3 Tags: custom taxonomy, custom tax, widget, sidebar, category, categories, taxonomy, custom category, custom categories, post types, custom post types, custom post type categories 4 4 Requires at least: 3.3 5 Tested up to: 6. 36 Stable tag: 4. 15 Tested up to: 6. 6 Stable tag: 4. 7 7 Description: Widget that list terms in a custom taxonomy (often used as categories or category types for a custom post type). 8 8 License: GPLv2 … … 29 29 30 30 == Changelog == 31 32 33 34 31 35 = 4.1 = 32 36 * Add support for selective refresh in the customizer, available in WordPress 4.5.
Note: See TracChangeset
for help on using the changeset viewer.