Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions inc/other-widget/widget-taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function veu_widget_description() {

function widget( $args, $instance ) {
$instance = static::get_defaults( $instance );

if ( ! isset( $instance['tax_name'] ) ) {
$instance['tax_name'] = 'category';
}
Expand All @@ -32,10 +32,10 @@ function widget( $args, $instance ) {
if ( ! isset( $instance['form_design'] ) ) {
$instance['form_design'] = 'list';
}



?>
if ( ! isset( $instance['form_sort'] ) ) {
$instance['form_sort'] = 'asc';
}
?>
<?php echo $args['before_widget']; ?>
<div class="sideWidget widget_taxonomies widget_nav_menu">
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
Expand All @@ -53,6 +53,8 @@ function widget( $args, $instance ) {
'hierarchical' => true,
'title_li' => '',
'taxonomy' => $instance['tax_name'],
'orderby' => 'name',
'order' => $instance['form_sort']
);
$tax_args = apply_filters( 'veu_widget_taxlist_args', $tax_args ); // 9.13.0.0

Expand All @@ -76,6 +78,8 @@ function widget( $args, $instance ) {
'taxonomy' => $instance['tax_name'],
'name' => $name,
'value_field' => 'slug',
'orderby' => 'name',
'order' => $instance['form_sort']
);
$tax_args = apply_filters( 'veu_widget_taxlist_args', $tax_args ); //

Expand Down Expand Up @@ -106,7 +110,7 @@ public static function get_defaults( $instance = array() ) {
function form( $instance ) {
$instance = static::get_defaults( $instance );
$taxs = get_taxonomies( array( 'public' => true ), 'objects' );
?>
?>

<!-- タイトル -->
<div style="margin-top:15px;">
Expand Down Expand Up @@ -140,7 +144,15 @@ function form( $instance ) {
<input style="margin-top:3px" type="checkbox" id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" value="true"<?php if ( $instance['hide_empty'] ) { echo ' checked';} ?>
/>
<label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>"><?php _e( 'Do not display terms without posts', 'vk-all-in-one-expansion-unit' ); ?></label>
</p>

<!-- [ Form sort ] -->
<div>
<label for="<?php echo $this->get_field_id( 'form_sort' ); ?>">Display order:</label>
<select name="<?php echo $this->get_field_name( 'form_sort' ); ?>" class="admin-custom-input">
<option value="asc" <?php selected( $instance['form_sort'], 'asc' ); ?>><?php _e('Ascending Order ( A → Z )','vk-all-in-one-expansion-unit');?></option>
<option value="desc" <?php selected( $instance['form_sort'], 'desc' ); ?>><?php _e('Descending Order ( Z → A )','vk-all-in-one-expansion-unit');?></option>
</select>
</div>

<script type="text/javascript">
jQuery(document).ready(function($){
Expand Down Expand Up @@ -178,6 +190,7 @@ function update( $new_instance, $old_instance ) {

$instance['form_design'] = $new_instance['form_design'];

$instance['form_sort'] = $new_instance['form_sort'];
return $instance;
}
}
Expand All @@ -190,4 +203,4 @@ function( $options ) {
},
10,
1
);
);
6 changes: 4 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ e.g.

== Changelog ==

[ Add setting ][ Category list ] Enable to specify ascending/descending order

= 9.99.6 =
[ Bug fix ][ Child Page List ] Fixed an issue related to a PHP error.

Expand All @@ -102,7 +104,7 @@ e.g.

= 9.99.0 =
[ Specification Change ][ Page top button ] Add #top on body for pagetop btn
[ Specification Change ][ Taxonomy Widget ] Add dropdown mode.
[ Specification Change ][ Taxonomy Widget ] Add dropdown mode.
[ Specification Change ] Foce Load JS from footer is abolished.
[ Fix ] Add a title attribute on Google Tag Manager (noscript)
[ Bug fix ] Fix XSS of Widgets, CTA, Custom Post Type Manager.
Expand Down Expand Up @@ -130,7 +132,7 @@ e.g.
[ Add setting ][ Post Type Manager ] Add a custom field setting.
[ Specification Change ][ Post Type Manager ] Change so that "with_front" can be specified as false in permalink settings
[ Bug Fix ][ SNS ] Fix OGP description on password protected page.
[ Bug Fix ][ Contact Section ] Fixed an issue where icons do not display when input in <i> tag format.
[ Bug Fix ][ Contact Section ] Fixed an issue where icons do not display when input in <i> tag format.
[ Design Bug Fix ][ Child Page List ] Fixed an issue where a blank space appeared above the excerpt.

= 9.95.0 =
Expand Down
Loading