AVH Extended Categories Widgets - Version 1.4.1

Version Description

Download this release

Release Info

Developer petervanderdoes
Plugin Icon wp plugin AVH Extended Categories Widgets
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.4 to 1.4.1

Files changed (2) hide show
  1. readme.txt +4 -2
  2. widget_extended_categories.php +10 -11
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: petervanderdoes, datafeedr.com
3
  Donate link: http://blog.avirtualhome.com/wordpress-plugins/
4
  Tags: extended, categories, widget
5
  Requires at least: 2.3
6
- Tested up to: 2.6.1
7
- Stable tag: 1.4
8
 
9
  Replacement of the category widget to allow for greater customization of the category widget.
10
 
@@ -40,6 +40,8 @@ I created a support site at http://forums.avirtualhome.com where you can ask que
40
  None
41
 
42
  == Arbitrary section ==
 
 
43
  * Version 1.4
44
  * Ability to have up to 9 widgets.
45
  * Version 1.3
3
  Donate link: http://blog.avirtualhome.com/wordpress-plugins/
4
  Tags: extended, categories, widget
5
  Requires at least: 2.3
6
+ Tested up to: 2.7
7
+ Stable tag: 1.4.1
8
 
9
  Replacement of the category widget to allow for greater customization of the category widget.
10
 
40
  None
41
 
42
  == Arbitrary section ==
43
+ * Version 1.4.1
44
+ * Bugfix: Problem when using multiple widgets with the dropdown option.
45
  * Version 1.4
46
  * Ability to have up to 9 widgets.
47
  * Version 1.3
widget_extended_categories.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Extended Category Widget
4
  Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
5
  Description: Replacement of the category widget to allow for greater customization of the category widget.
6
- Version: 1.4
7
  Author: Peter van der Does
8
  Author URI: http://blog.avirtualhome.com/
9
 
@@ -31,6 +31,7 @@ function widget_extended_categories_init() {
31
  }
32
 
33
  function widget_extended_categories($args, $number = 1) {
 
34
  // Check for version
35
  global $wp_version;
36
  if ( version_compare($wp_version, '2.5.1', '<') ) {
@@ -52,12 +53,12 @@ function widget_extended_categories_init() {
52
  $post_category = unserialize ( $options [$number]['post_category'] );
53
  $included_cats = implode ( ",", $post_category );
54
  }
55
- $cat_args = array ('include' => $included_cats, 'orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h, 'title_li' => '', 'show_option_none' => __ ( 'Select Category' ) );
56
  } else {
57
- $cat_args = array ('orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h, 'title_li' => '', 'show_option_none' => __ ( 'Select Category' ) );
58
  }
59
  echo $before_widget;
60
- echo '<!-- AVH Extended Categories | http://blog.avirtualhome.com/wordpress-plugins/ -->';
61
  echo $before_title . $title . $after_title;
62
  echo '<ul>';
63
 
@@ -67,15 +68,13 @@ function widget_extended_categories_init() {
67
  wp_dropdown_categories ( $cat_args );
68
  ?>
69
  <script lang='javascript'><!--
70
- var dropdown = document.getElementById("cat");
71
- function onCatChange() {
72
- if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
73
- location.href = "<?php
74
- echo get_option ( 'home' );
75
- ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
76
  }
77
  }
78
- dropdown.onchange = onCatChange;
79
  --></script>
80
  <?php
81
  }
3
  Plugin Name: Extended Category Widget
4
  Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
5
  Description: Replacement of the category widget to allow for greater customization of the category widget.
6
+ Version: 1.4.1
7
  Author: Peter van der Does
8
  Author URI: http://blog.avirtualhome.com/
9
 
31
  }
32
 
33
  function widget_extended_categories($args, $number = 1) {
34
+ $version = '1.4.1';
35
  // Check for version
36
  global $wp_version;
37
  if ( version_compare($wp_version, '2.5.1', '<') ) {
53
  $post_category = unserialize ( $options [$number]['post_category'] );
54
  $included_cats = implode ( ",", $post_category );
55
  }
56
+ $cat_args = array ('include' => $included_cats, 'orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h, 'title_li' => '', 'show_option_none' => __ ( 'Select Category' ), 'name' => 'ec-cat-'.$number );
57
  } else {
58
+ $cat_args = array ('orderby' => $s, 'order' => $o, 'show_count' => $c, 'hide_empty' => $e, 'hierarchical' => $h, 'title_li' => '', 'show_option_none' => __ ( 'Select Category' ), 'name' => 'ec-cat-'.$number);
59
  }
60
  echo $before_widget;
61
+ echo '<!-- AVH Extended Categories version ' . $version .' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
62
  echo $before_title . $title . $after_title;
63
  echo '<ul>';
64
 
68
  wp_dropdown_categories ( $cat_args );
69
  ?>
70
  <script lang='javascript'><!--
71
+ var ec_dropdown_<?php echo ($number); ?> = document.getElementById('ec-cat-<?php echo ($number); ?>');
72
+ function ec_onCatChange_<?php echo ($number); ?>() {
73
+ if ( ec_dropdown_<?php echo ($number); ?>.options[ec_dropdown_<?php echo ($number); ?>.selectedIndex].value > 0 ) {
74
+ location.href = "<?php echo get_option ( 'home' ); ?>/?cat="+ec_dropdown_<?php echo ($number); ?>.options[ec_dropdown_<?php echo ($number); ?>.selectedIndex].value;
 
 
75
  }
76
  }
77
+ ec_dropdown_<?php echo ($number); ?>.onchange = ec_onCatChange_<?php echo ($number); ?>;
78
  --></script>
79
  <?php
80
  }