Plugin Directory

Changeset 3071992

Timestamp:
04/16/2024 11:01:59 PM (4 months ago)
Author:
celloexpressions
Message:

List Custom Taxonomy Widget: Version 4.2, see readme.

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  
    44 * Plugin URI: http://celloexpressions.com/plugins/list-custom-taxonomy-widget
    55 * Description: Widget that displays category listings for custom post types (custom taxonomies).
    6  * Version: 4.1
     6 * Version: 4.
    77 * Author: Nick Halsey
    88 * Author URI: http://celloexpressions.com/
     
    1212 
    1313=====================================================================================
    14 Copyright (C) 2017 Nick Halsey
     14Copyright (C) 20 Nick Halsey
    1515
    1616This program is free software; you can redistribute it and/or
     
    6060            $this_taxonomy = '';
    6161        }
    62         $hierarchical = !empty( $instance['hierarchical'] ) ? '1' : '0';
     62        $hierarchical = !empty( $instance['hierarchical'] ) ? ;
    6363        $inv_empty = !empty( $instance['empty'] ) ? '0' : '1'; // invert to go from UI's "show empty" to WP's "hide empty"
    6464        $showcount = !empty( $instance['count'] ) ? '1' : '0';
     
    9999        }
    100100        // Output
    101         $tax = $this_taxonomy;
     101        $tax = ;
    102102        echo $before_widget;
    103103        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;
    105105        if($dropdown){
    106106            $taxonomy_object = get_taxonomy( $tax );
     
    130130                'walker'            => $walker,
    131131            );
    132             echo '<form action="'. get_bloginfo('url'). '" method="get">';
    133             wp_dropdown_categories($args);
     132            echo '<form action="'. . '" method="get">';
     133            wp_dropdown_categories();
    134134            $dropdown_submit_text = apply_filters( 'list_custom_taxonomy_widget_dropdown_submit_text', __( 'go &raquo;', 'list-custom-taxonomy-widget' ) );
    135135            echo '<input type="submit" value"' . esc_attr( $dropdown_submit_text ) . '" /></form>';
     
    163163                );
    164164            echo '<ul id="lct-widget-'.$tax.'">';
    165             wp_list_categories($args);
     165            wp_list_categories();
    166166            echo '</ul>';
    167167        }
     
    173173        $instance = $old_instance;
    174174       
    175         $instance['title']  = strip_tags( $new_instance['title'] );
    176         $instance['taxonomy'] = strip_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'] = ;
    182182        $instance['hierarchical'] = !empty($new_instance['hierarchical']) ? 1 : 0;
    183183        $instance['empty'] = !empty($new_instance['empty']) ? 1 : 0;
     
    192192    **/
    193193    function form( $instance ) {
    194         //for showing/hiding advanced options; wordpress moves this script to where it needs to go
    195             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><?php
    217194          // instance exist? if not set defaults
    218195            if ( $instance ) {
     
    242219                $dropdown = false;
    243220            }
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
    244244           
    245245        // The widget form ?>
    246246            <p>
    247247                <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" />
    249249            </p>
    250250            <p>
     
    267267            </select>
    268268            </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&hellip;', '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&hellip;', 'list-custom-taxonomy-widget' ); ?></a></h4>
     270            <div class="lctw-all-options">
    271271                <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>
    272272                <input type="hidden" value="<?php echo $expandoptions; ?>" id="<?php echo $this->get_field_id('expandoptions'); ?>" name="<?php echo $this->get_field_name('expandoptions'); ?>" />
     
    295295                <p>
    296296                    <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 ; ?>" />
    298298                </p>
    299299                <p>
    300300                    <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 ; ?>" />
    302302                </p>
    303303                <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  
    33Tags: custom taxonomy, custom tax, widget, sidebar, category, categories, taxonomy, custom category, custom categories, post types, custom post types, custom post type categories
    44Requires at least: 3.3
    5 Tested up to: 6.3
    6 Stable tag: 4.1
     5Tested up to: 6.
     6Stable tag: 4.
    77Description: Widget that list terms in a custom taxonomy (often used as categories or category types for a custom post type).
    88License: GPLv2
     
    2929
    3030== Changelog ==
     31
     32
     33
     34
    3135= 4.1 =
    3236* Add support for selective refresh in the customizer, available in WordPress 4.5.
Note: See TracChangeset for help on using the changeset viewer.