Commit ae2308c2 authored by shammash's avatar shammash Committed by lechuck
Browse files

updated extended categories widget to 3.4.2

parent baee8673
...@@ -123,14 +123,13 @@ class AVH_EC_Category_Group ...@@ -123,14 +123,13 @@ class AVH_EC_Category_Group
function doSetupOptions () function doSetupOptions ()
{ {
// Setup the standard groups if the none group does not exists. // Setup the standard groups if the none group does not exists.
$all_categories = $this->getAllCategoriesTermID();
if (false === $this->getTermIDBy('slug', 'none')) { if (false === $this->getTermIDBy('slug', 'none')) {
$none_group_id = wp_insert_term('none', $this->taxonomy_name, array('description'=>__('This group will not show the widget.', 'avh-ec'))); $none_group_id = wp_insert_term('none', $this->taxonomy_name, array('description'=>__('This group will not show the widget.', 'avh-ec')));
$all_group_id = wp_insert_term('All', $this->taxonomy_name, array('description'=>__('Holds all the categories.', 'avh-ec'))); $all_group_id = wp_insert_term('All', $this->taxonomy_name, array('description'=>__('Holds all the categories.', 'avh-ec')));
$home_group_id = wp_insert_term('Home', $this->taxonomy_name, array('description'=>__('This group will be shown on the front page.', 'avh-ec'))); $home_group_id = wp_insert_term('Home', $this->taxonomy_name, array('description'=>__('This group will be shown on the front page.', 'avh-ec')));
// Fill the standard groups with all categories // Fill the standard groups with all categories
$all_categories = $this->getAllCategoriesTermID();
$this->setCategoriesForGroup($all_group_id['term_id'], $all_categories);
$this->setCategoriesForGroup($home_group_id['term_id'], $all_categories); $this->setCategoriesForGroup($home_group_id['term_id'], $all_categories);
$this->setWidgetTitleForGroup($all_group_id['term_id'], ''); $this->setWidgetTitleForGroup($all_group_id['term_id'], '');
$this->setWidgetTitleForGroup($home_group_id['term_id'], ''); $this->setWidgetTitleForGroup($home_group_id['term_id'], '');
...@@ -146,6 +145,7 @@ class AVH_EC_Category_Group ...@@ -146,6 +145,7 @@ class AVH_EC_Category_Group
update_option($this->db_options_widget_titles, $options); update_option($this->db_options_widget_titles, $options);
} }
$this->options_widget_titles = $options; $this->options_widget_titles = $options;
$this->setCategoriesForGroup($this->getTermIDBy('slug', 'all'), $all_categories);
} }
/** /**
......
...@@ -27,7 +27,7 @@ class AVH_EC_Core ...@@ -27,7 +27,7 @@ class AVH_EC_Core
*/ */
$catgrp = & AVH_EC_Singleton::getInstance('AVH_EC_Category_Group'); $catgrp = & AVH_EC_Singleton::getInstance('AVH_EC_Category_Group');
$this->version = '3.4'; $this->version = '3.4.2';
$this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->'; $this->comment = '<!-- AVH Extended Categories version ' . $this->version . ' | http://blog.avirtualhome.com/wordpress-plugins/ -->';
$this->db_options_core = 'avhec'; $this->db_options_core = 'avhec';
$this->db_options_tax_meta = 'avhec-tax_meta'; $this->db_options_tax_meta = 'avhec-tax_meta';
......
...@@ -591,13 +591,16 @@ class WP_Widget_AVH_ExtendedCategories_Category_Group extends WP_Widget ...@@ -591,13 +591,16 @@ class WP_Widget_AVH_ExtendedCategories_Category_Group extends WP_Widget
if ('none' == $special_page) { if ('none' == $special_page) {
$terms = wp_get_object_terms($post->ID, $catgrp->taxonomy_name); $terms = wp_get_object_terms($post->ID, $catgrp->taxonomy_name);
if (! empty($terms)) { if (! empty($terms)) {
$selected_catgroups = unserialize($instance['post_group_category']);
foreach ($terms as $key => $value) { foreach ($terms as $key => $value) {
if ($selected_catgroups === FALSE || array_key_exists($value->term_id, $selected_catgroups)) {
if (! ($this->getWidgetDoneCatGroup($value->term_id))) { if (! ($this->getWidgetDoneCatGroup($value->term_id))) {
$row = $value; $row = $value;
$group_found = TRUE; $group_found = TRUE;
break; break;
} }
} }
}
} else { } else {
$options = $this->core->options; $options = $this->core->options;
$no_cat_group = $options['cat_group']['no_group']; $no_cat_group = $options['cat_group']['no_group'];
...@@ -630,7 +633,7 @@ class WP_Widget_AVH_ExtendedCategories_Category_Group extends WP_Widget ...@@ -630,7 +633,7 @@ class WP_Widget_AVH_ExtendedCategories_Category_Group extends WP_Widget
$toDisplay = FALSE; $toDisplay = FALSE;
} elseif (! (FALSE == $selected_catgroups || array_key_exists($row->term_id, $selected_catgroups))) { } elseif (! (FALSE == $selected_catgroups || array_key_exists($row->term_id, $selected_catgroups))) {
$toDisplay = FALSE; $toDisplay = FALSE;
} elseif ($this->getWidgetDoneCatGroup($sp_category_group_id)) { } elseif ($special_page != 'none' && $this->getWidgetDoneCatGroup($sp_category_group_id)) {
$toDisplay = FALSE; $toDisplay = FALSE;
} }
} }
......
...@@ -3,8 +3,8 @@ Contributors: petervanderdoes ...@@ -3,8 +3,8 @@ Contributors: petervanderdoes
Donate link: http://blog.avirtualhome.com/wordpress-plugins/ Donate link: http://blog.avirtualhome.com/wordpress-plugins/
Tags: extended, categories, widget, top categories Tags: extended, categories, widget, top categories
Requires at least: 2.3 Requires at least: 2.3
Tested up to: 3.1 Tested up to: 3.2.1
Stable tag: 3.4 Stable tag: 3.4.2
The AVH Extended Categories Widgets gives you three widgets for displaying categories. The AVH Extended Categories Widgets gives you three widgets for displaying categories.
== Description == == Description ==
...@@ -134,6 +134,14 @@ Whether Widget 2 shows Movie or Music depends on the creation order of groups. I ...@@ -134,6 +134,14 @@ Whether Widget 2 shows Movie or Music depends on the creation order of groups. I
None None
== Changelog == == Changelog ==
= Version 3.4.2 =
* Bugfix: Fails to display the Category Group Widget when the widget is to display any group.
* Foo line
= Version 3.4.1 =
* Bugfix: Problems with multiple category group widgets.
* Bugfix: The category group All sometimes does not contain all categories.
= Version 3.4 = = Version 3.4 =
* RFC: Category Groups can be associated with categories. This enables the plugin to display the Category Group Widget for that category group on the category archive page. * RFC: Category Groups can be associated with categories. This enables the plugin to display the Category Group Widget for that category group on the category archive page.
* Bugfix: In combination with WP Supercache an error can occur. * Bugfix: In combination with WP Supercache an error can occur.
......
...@@ -9,7 +9,7 @@ function widget_extended_categories_init () ...@@ -9,7 +9,7 @@ function widget_extended_categories_init ()
function widget_extended_categories ($args, $number = 1) function widget_extended_categories ($args, $number = 1)
{ {
$version = '3.4'; $version = '3.4.2';
// Check for version // Check for version
require (ABSPATH . WPINC . '/version.php'); require (ABSPATH . WPINC . '/version.php');
if (version_compare($wp_version, '2.5.1', '<')) { if (version_compare($wp_version, '2.5.1', '<')) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Plugin Name: AVH Extended Categories Widgets Plugin Name: AVH Extended Categories Widgets
Plugin URI: http://blog.avirtualhome.com/wordpress-plugins Plugin URI: http://blog.avirtualhome.com/wordpress-plugins
Description: Replacement of the category widget to allow for greater customization of the category widget. Description: Replacement of the category widget to allow for greater customization of the category widget.
Version: 3.4 Version: 3.4.2
Author: Peter van der Does Author: Peter van der Does
Author URI: http://blog.avirtualhome.com/ Author URI: http://blog.avirtualhome.com/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment