Permalink
Browse files

Merge branch 'release/3.6.4'

  • Loading branch information...
petervanderdoes committed Mar 15, 2012
2 parents debe07b + ec2e87b commit a38c75537ae5b8052fd7000cf84c4a3b703f5eb8
Showing with 37 additions and 12 deletions.
  1. +1 −1 2.8/class/avh-ec.core.php
  2. +29 −7 3.3/class/avh-ec.core.php
  3. +1 −1 3.3/class/avh-ec.widgets.php
  4. +4 −1 readme.txt
  5. +1 −1 widget-pre2.8.php
  6. +1 −1 widget_extended_categories.php
@@ -27,7 +27,7 @@ function __construct ()
*/
$catgrp = & AVH_EC_Singleton::getInstance('AVH_EC_Category_Group');
- $this->version = '3.6.3';
+ $this->version = '3.6.4';
$this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
$this->db_options_core = 'avhec';
$this->db_options_tax_meta = 'avhec-tax_meta';
View
@@ -27,7 +27,7 @@ function __construct ()
*/
$catgrp = & AVH_EC_Singleton::getInstance('AVH_EC_Category_Group');
- $this->version = '3.6.3';
+ $this->version = '3.6.4';
$this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
$this->db_options_core = 'avhec';
$this->db_options_tax_meta = 'avhec-tax_meta';
@@ -324,8 +324,21 @@ function avh_wp_dropdown_categories ($args = '', $selectedonly)
{
$mywalker = new AVH_Walker_CategoryDropdown();
- $defaults = array ( 'show_option_all' => '', 'show_option_none' => '', 'orderby' => 'id', 'order' => 'ASC', 'show_last_update' => 0, 'show_count' => 0, 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1, 'selected' => 0, 'hierarchical' => 0, 'name' => 'cat', 'class' => 'postform', 'depth' => 0, 'tab_index' => 0, 'walker' => $mywalker );
-
+ // @format_off
+ $defaults = array(
+ 'show_option_all' => '', 'show_option_none' => '',
+ 'orderby' => 'id', 'order' => 'ASC',
+ 'show_last_update' => 0, 'show_count' => 0,
+ 'hide_empty' => 1, 'child_of' => 0,
+ 'exclude' => '', 'echo' => 1,
+ 'selected' => 0, 'hierarchical' => 0,
+ 'name' => 'cat', 'id' => '',
+ 'class' => 'postform', 'depth' => 0,
+ 'tab_index' => 0, 'taxonomy' => 'category',
+ 'walker' => $mywalker,
+ 'hide_if_empty' => false
+ );
+ // @format_on
$defaults['selected'] = (is_category()) ? get_query_var('cat') : 0;
$r = wp_parse_args($args, $defaults);
@@ -341,13 +354,21 @@ function avh_wp_dropdown_categories ($args = '', $selectedonly)
if ((int) $tab_index > 0)
$tab_index_attribute = ' tabindex="' . $tab_index . '"';
- $categories = get_categories($r);
+ $categories = get_terms($taxonomy, $r);
$name = esc_attr($name);
$class = esc_attr($class);
+ $id = $id ? esc_attr($id) : $name;
- $output = '';
+ if (! $r['hide_if_empty'] || ! empty($categories))
+ $output = "<select name='$name' id='$id' class='$class' $tab_index_attribute>\n";
+ else
+ $output = '';
+
+ if (empty($categories) && ! $r['hide_if_empty'] && ! empty($show_option_none)) {
+ $show_option_none = apply_filters('list_cats', $show_option_none);
+ $output .= "\t<option value='-1' selected='selected'>$show_option_none</option>\n";
+ }
if (! empty($categories)) {
- $output = '<select name="' . $name . '" id="' . $name . '" class="' . $class . '" ' . $tab_index_attribute . '>' . "\n";
if ($show_option_all) {
$show_option_all = apply_filters('list_cats', $show_option_all);
@@ -367,8 +388,9 @@ function avh_wp_dropdown_categories ($args = '', $selectedonly)
$depth = - 1; // Flat
}
$output .= walk_category_dropdown_tree($categories, $depth, $r);
- $output .= "</select>\n";
}
+ if (! $r['hide_if_empty'] || ! empty($categories))
+ $output .= "</select>\n";
$output = apply_filters('wp_dropdown_cats', $output);
@@ -121,7 +121,7 @@ function widget ($args, $instance)
echo ' var ec_dropdown_' . $this->number . ' = document.getElementById("extended-categories-select-' . $this->number . '");' . "\n";
echo ' function ec_onCatChange_' . $this->number . '() {' . "\n";
echo ' if ( ec_dropdown_' . $this->number . '.options[ec_dropdown_' . $this->number . '.selectedIndex].value > 0 ) {' . "\n";
- echo ' location.href = "' . get_option('home') . '/?cat="+ec_dropdown_' . $this->number . '.options[ec_dropdown_' . $this->number . '.selectedIndex].value;' . "\n";
+ echo ' location.href = "' .home_url() . '/?cat="+ec_dropdown_' . $this->number . '.options[ec_dropdown_' . $this->number . '.selectedIndex].value;' . "\n";
echo ' }' . "\n";
echo ' }' . "\n";
echo ' ec_dropdown_' . $this->number . '.onchange = ec_onCatChange_' . $this->number . ';' . "\n";
View
@@ -4,7 +4,7 @@ Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags: extended, categories, widget, top categories
Requires at least: 2.3
Tested up to: 3.3
-Stable tag: 3.6.3
+Stable tag: 3.6.4
The AVH Extended Categories Widgets gives you three widgets for displaying categories.
== Description ==
@@ -134,6 +134,9 @@ Whether Widget 2 shows Movie or Music depends on the creation order of groups. I
None
== Changelog ==
+= Version 3.6.4 =
+* Bugfix: Problem with categories not showing up when showing dropdown categories.
+
= Version 3.6.3 =
* Bugfix: Problem with url's on Windows platform.
View
@@ -9,7 +9,7 @@ function widget_extended_categories_init ()
function widget_extended_categories ($args, $number = 1)
{
- $version = '3.6.3';
+ $version = '3.6.4';
// Check for version
require (ABSPATH . WPINC . '/version.php');
if (version_compare($wp_version, '2.5.1', '<')) {
@@ -3,7 +3,7 @@
Plugin Name: AVH Extended Categories Widgets
Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
Description: Replacement of the category widget to allow for greater customization of the category widget.
-Version: 3.6.3
+Version: 3.6.4
Author: Peter van der Does
Author URI: http://blog.avirtualhome.com/

0 comments on commit a38c755

Please sign in to comment.