Advanced Sidebar Menu - Version 3.2.1

Version Description

  • Fix a possible bug that may display a * Notice * error if there is nothing to display and the error reporting is set to strict when using the categories widget.
Download this release

Release Info

Developer Mat Lipe
Plugin Icon 128x128 Advanced Sidebar Menu
Version 3.2.1
Comparing to
See all releases

Code changes from version 3.2.0 to 3.2.1

advanced-sidebar-menu.php CHANGED
@@ -4,9 +4,9 @@ Plugin Name: Advanced Sidebar Menu
4
Plugin URI: http://lipeimagination.info
5
Description: Creates dynamic menu based on child/parent relationship.
6
Author: Mat Lipe
7
- Version: 3.2
8
Author URI: http://lipeimagination.info
9
- Since: 6/3/12
10
Email: mat@lipeimagination.info
11
12
*/
4
Plugin URI: http://lipeimagination.info
5
Description: Creates dynamic menu based on child/parent relationship.
6
Author: Mat Lipe
7
+ Version: 3.2.1
8
Author URI: http://lipeimagination.info
9
+ Since: 6/4/12
10
Email: mat@lipeimagination.info
11
12
*/
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypa
4
Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
Requires at least: 3.1
6
Tested up to: 3.3.2
7
- Stable tag: 3.2.0
8
- Version: 3.2.0
9
10
== Description ==
11
@@ -13,7 +13,10 @@ Creates a widget that automatically generates a menu based on the parent/child r
13
of the pages. When on a top level page, it displays a menu of the all of the top level pages and a menu of all of the pages that
14
are children of the current page. Keeps the sidebar menu clean and usable.
15
16
- As of Version 3.0 it also creates a widget that does the same functionality for Categories as well.
17
18
Has the ability to exclude page from the menu.
19
As of 2.0 it also allows for display of all the child pages always.
@@ -34,6 +37,10 @@ e.g.
34
35
== Frequently Asked Questions ==
36
37
= How do you edit the output or built in css? =
38
39
Create a folder in your child theme named "advanced-sidebar-menu" copy any of the files from the "views" folder into
@@ -58,6 +65,9 @@ You may want to use something like margins to set the levels apart.
58
59
== Changelog ==
60
61
= 3.2.0 =
62
* Added ability to have categories show on single post pages
63
* Improved the code structure
4
Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
Requires at least: 3.1
6
Tested up to: 3.3.2
7
+ Stable tag: 3.2.1
8
+ Version: 3.2.1
9
10
== Description ==
11
13
of the pages. When on a top level page, it displays a menu of the all of the top level pages and a menu of all of the pages that
14
are children of the current page. Keeps the sidebar menu clean and usable.
15
16
+ As of Version 3.2 you have the option to display the categories on single post page when using the categories widget.
17
+
18
+
19
+ As of Version 3.0 it also creates a widget that does the same functionality for Categories.
20
21
Has the ability to exclude page from the menu.
22
As of 2.0 it also allows for display of all the child pages always.
37
38
== Frequently Asked Questions ==
39
40
+ = How do you get the categories to display on single post pages? =
41
+
42
+ There is a checkbox in the widget options as of version 3.2 that will display the same structure for the categories the post is in.
43
+
44
= How do you edit the output or built in css? =
45
46
Create a folder in your child theme named "advanced-sidebar-menu" copy any of the files from the "views" folder into
65
66
== Changelog ==
67
68
+ = 3.2.1 =
69
+ * Fix a possible bug that may display a * Notice * error if there is nothing to display and the error reporting is set to strict when using the categories widget.
70
+
71
= 3.2.0 =
72
* Added ability to have categories show on single post pages
73
* Improved the code structure
widgets/category.widget.php CHANGED
@@ -127,10 +127,11 @@ class advanced_sidebar_menu_category extends WP_Widget {
127
#-- Create a usable array of the excluded pages
128
$exclude = explode(',', $instance['exclude']);
129
$cat_ids = array();
130
- $asm_cat_widget_count = false; //keeps track of how many widgets this created
131
$count = null;
132
133
134
//If on a single page create an array of each category and create a list for each
135
if( is_single() && ($instance['single'] == 'checked') ){
136
$category_array = get_the_category();
@@ -164,7 +165,7 @@ class advanced_sidebar_menu_category extends WP_Widget {
164
$cat_ancestors[] = $cat_id ; }
165
while ($cat_id );
166
167
-
168
$cat_ancestors = array_reverse( $cat_ancestors );
169
$top_cat = $cat_ancestors [1];
170
@@ -176,18 +177,15 @@ class advanced_sidebar_menu_category extends WP_Widget {
176
if( !empty($all ) || ($instance['include_childless_parent'] == 'checked' && !in_array($top_cat, $exclude)) ){
177
178
179
-
180
- #!! Bring in the output from either the child theme or this folder
181
-
182
//Creates a new widget for each category the single page has if the options are selected to do so
183
if( !$asm_once || ($instance['new_widget'] == 'widget') ){
184
185
echo '<div id="'.$args['widget_id']. $count .'" class="advanced-sidebar-menu widget advanced-sidebar-category">
186
<div class="widget-wrap">';
187
188
- $count++;
189
- $asm_once = true;
190
- $close = true;
191
if($instance['new_widget'] == 'list'){ $close = false;} //If this is a list leave it open for possible late ones
192
193
} else {
127
#-- Create a usable array of the excluded pages
128
$exclude = explode(',', $instance['exclude']);
129
$cat_ids = array();
130
+ $asm_once = $asm_cat_widget_count = false; //keeps track of how many widgets this created
131
$count = null;
132
133
134
+
135
//If on a single page create an array of each category and create a list for each
136
if( is_single() && ($instance['single'] == 'checked') ){
137
$category_array = get_the_category();
165
$cat_ancestors[] = $cat_id ; }
166
while ($cat_id );
167
168
+
169
$cat_ancestors = array_reverse( $cat_ancestors );
170
$top_cat = $cat_ancestors [1];
171
177
if( !empty($all ) || ($instance['include_childless_parent'] == 'checked' && !in_array($top_cat, $exclude)) ){
178
179
180
//Creates a new widget for each category the single page has if the options are selected to do so
181
if( !$asm_once || ($instance['new_widget'] == 'widget') ){
182
183
echo '<div id="'.$args['widget_id']. $count .'" class="advanced-sidebar-menu widget advanced-sidebar-category">
184
<div class="widget-wrap">';
185
186
+ $count++; // To change the id of the widget if there are multiple
187
+ $asm_once = true; //There has been a div
188
+ $close = true; //The div should be closed at the end
189
if($instance['new_widget'] == 'list'){ $close = false;} //If this is a list leave it open for possible late ones
190
191
} else {