Advanced Sidebar Menu - Version 4.5.0

Version Description

  • Improved filter structure to allow for add-ons to work more effectively
Download this release

Release Info

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

Code changes from version 4.4.0 to 4.5.0

advanced-sidebar-menu.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /*
3
  Plugin Name: Advanced Sidebar Menu
4
- Plugin URI: http://lipeimagination.info/wordpress/advanced-sidebar-menu/
5
  Description: Creates dynamic menu based on child/parent relationship.
6
  Author: Mat Lipe
7
- Version: 4.4.0
8
- Author URI: http://lipeimagination.info
9
- Since: 8.29.13
10
  */
11
 
12
 
1
  <?php
2
  /*
3
  Plugin Name: Advanced Sidebar Menu
4
+ Plugin URI: http://matlipe.com/advanced-sidebar-menu/
5
  Description: Creates dynamic menu based on child/parent relationship.
6
  Author: Mat Lipe
7
+ Version: 4.5.0
8
+ Author URI: http://matlipe.com
9
+ Since: 9.24.13
10
  */
11
 
12
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Mat Lipe
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40lipeimagination%2einfo&lc=US&item_name=Advanced%20Sidebar%20Menu&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
  Requires at least: 3.1
6
- Tested up to: 3.6.0
7
- Stable tag: 4.4.0
8
 
9
  Creates a widget for both page and categories that will display the current page/category and all child pages or categories.
10
 
@@ -113,6 +113,10 @@ I do offer preminum services for buiding custom add-ons for additional functiona
113
 
114
 
115
  == Changelog ==
 
 
 
 
116
  = 4.4.0 =
117
  * Added a has_children class to page links with hidden children
118
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40lipeimagination%2einfo&lc=US&item_name=Advanced%20Sidebar%20Menu&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: menus, sidebar menu, heirchy, category menu, pages menu
5
  Requires at least: 3.1
6
+ Tested up to: 3.6.1
7
+ Stable tag: 4.5.0
8
 
9
  Creates a widget for both page and categories that will display the current page/category and all child pages or categories.
10
 
113
 
114
 
115
  == Changelog ==
116
+ = 4.5.0 =
117
+ * Improved filter structure to allow for add-ons to work more effectively
118
+
119
+
120
  = 4.4.0 =
121
  * Added a has_children class to page links with hidden children
122
 
views/page_list.php CHANGED
@@ -2,7 +2,10 @@
2
  /**
3
  * The Ouput of the Advanced Sidebar Page Widget
4
  * @author Mat Lipe
5
- * @since 5.19.13
 
 
 
6
  *
7
  *
8
  * @uses to edit, create a file named page_list.php and put in a folder in the your theme called 'advanced-sidebar-menu
@@ -28,7 +31,7 @@ if( $child_pages ){
28
  #-- If they want all the pages displayed always
29
  if( $asm->display_all() ){
30
 
31
- $content .= wp_list_pages("post_type=".$post_type."&sort_column=$order_by&title_li=&echo=0&child_of=".$top_parent."&depth=".$instance['levels']."&exclude=".$instance['exclude']);
32
  } else {
33
 
34
  #-- Display children of current page's parent only
2
  /**
3
  * The Ouput of the Advanced Sidebar Page Widget
4
  * @author Mat Lipe
5
+ *
6
+ * @since 4.5.0
7
+ *
8
+ * @since 9.24.13
9
  *
10
  *
11
  * @uses to edit, create a file named page_list.php and put in a folder in the your theme called 'advanced-sidebar-menu
31
  #-- If they want all the pages displayed always
32
  if( $asm->display_all() ){
33
 
34
+ $content .= wp_list_pages("post_type=".$post_type."&sort_column=$order_by&title_li=&echo=0&child_of=".$top_parent."&depth=".$instance['levels']."&exclude=".implode(',',$asm->exclude) );
35
  } else {
36
 
37
  #-- Display children of current page's parent only
widgets/page.widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Creates a Widget of parent Child Pages
4
  *
5
  * @author mat lipe
6
- * @since 8.29.13
7
  * @package Advanced Sidebar Menu
8
  *
9
  */
@@ -158,25 +158,26 @@ class advanced_sidebar_menu_page extends WP_Widget {
158
  * apply_filters('advanced_sidebar_menu_post_type', 'page', $args, $instance );
159
  *
160
  *
161
- * @since 8.29.13
162
  *
163
  * @see Geansai - pointed out a notice level error. Thanks Geansai!!
164
  */
165
  function widget($args, $instance) {
166
  global $wpdb, $post, $table_prefix;
167
-
168
-
169
- $asm = new advancedSidebarMenu;
170
 
171
  $asm->instance = $instance;
172
  $asm->args = $args;
173
- $exclude = explode(',', $instance['exclude']);
174
- $asm->exclude = $exclude;
175
 
 
 
 
 
176
  extract($args);
177
 
178
  //Filter this one with a 'single' for a custom post type will default to working for pages only
179
- $post_type = apply_filters('advanced_sidebar_menu_post_type', 'page', $args, $instance );
180
  $asm->post_type = $post_type;
181
 
182
  //Add a has_children class to appropriate pages
@@ -188,11 +189,9 @@ class advanced_sidebar_menu_page extends WP_Widget {
188
  }
189
 
190
 
191
-
192
-
193
  $proper_single = !(is_single() || is_page() ) || (get_post_type() != $post_type);
194
  //Filter the single post check if try to display the menu somewhere else like a category page
195
- if( apply_filters('advanced_sidebar_menu_proper_single', $proper_single, $args, $instance) ) return;
196
 
197
 
198
  //Get the Top Parent Id
@@ -203,7 +202,7 @@ class advanced_sidebar_menu_page extends WP_Widget {
203
  $top_parent = $post->ID;
204
  }
205
  //Filter for specifying the top parent
206
- $top_parent = apply_filters('advanced_sidebar_menu_top_parent', $top_parent, $post, $args, $instance );
207
  $asm->top_id = $top_parent;
208
 
209
 
@@ -212,7 +211,7 @@ class advanced_sidebar_menu_page extends WP_Widget {
212
 
213
 
214
  //Filter for specifiying the order by
215
- $order_by = apply_filters('advanced_sidebar_menu_order_by', $instance['order_by'], $post, $args, $instance );
216
  $asm->order_by = $order_by;
217
 
218
 
@@ -223,8 +222,7 @@ class advanced_sidebar_menu_page extends WP_Widget {
223
 
224
  //for depreciation
225
  $p = $top_parent;
226
- $result = $child_pages = apply_filters( 'advanced_sidebar_menu_child_pages', $child_pages, $post, $args, $instance );
227
-
228
 
229
  #---- if there are no children do not display the parent unless it is check to do so
230
  if( (!empty($child_pages)) || $asm->checked('include_childless_parent') && (!in_array($top_parent, $exclude) ) ){
3
  * Creates a Widget of parent Child Pages
4
  *
5
  * @author mat lipe
6
+ * @since 9.24.13
7
  * @package Advanced Sidebar Menu
8
  *
9
  */
158
  * apply_filters('advanced_sidebar_menu_post_type', 'page', $args, $instance );
159
  *
160
  *
161
+ * @since 9.24.13
162
  *
163
  * @see Geansai - pointed out a notice level error. Thanks Geansai!!
164
  */
165
  function widget($args, $instance) {
166
  global $wpdb, $post, $table_prefix;
167
+
168
+ $asm = new advancedSidebarMenu();
 
169
 
170
  $asm->instance = $instance;
171
  $asm->args = $args;
 
 
172
 
173
+ //The excluded pages
174
+ $exclude = apply_filters( 'advanced_sidebar_menu_excluded_pages', explode(',', $instance['exclude']), $post, $args, $instance, $asm );
175
+ $asm->exclude = $exclude;
176
+
177
  extract($args);
178
 
179
  //Filter this one with a 'single' for a custom post type will default to working for pages only
180
+ $post_type = apply_filters('advanced_sidebar_menu_post_type', 'page', $args, $instance, $asm );
181
  $asm->post_type = $post_type;
182
 
183
  //Add a has_children class to appropriate pages
189
  }
190
 
191
 
 
 
192
  $proper_single = !(is_single() || is_page() ) || (get_post_type() != $post_type);
193
  //Filter the single post check if try to display the menu somewhere else like a category page
194
+ if( apply_filters('advanced_sidebar_menu_proper_single', $proper_single, $args, $instance, $asm) ) return;
195
 
196
 
197
  //Get the Top Parent Id
202
  $top_parent = $post->ID;
203
  }
204
  //Filter for specifying the top parent
205
+ $top_parent = apply_filters('advanced_sidebar_menu_top_parent', $top_parent, $post, $args, $instance, $asm );
206
  $asm->top_id = $top_parent;
207
 
208
 
211
 
212
 
213
  //Filter for specifiying the order by
214
+ $order_by = apply_filters('advanced_sidebar_menu_order_by', $instance['order_by'], $post, $args, $instance, $asm );
215
  $asm->order_by = $order_by;
216
 
217
 
222
 
223
  //for depreciation
224
  $p = $top_parent;
225
+ $result = $child_pages = apply_filters( 'advanced_sidebar_menu_child_pages', $child_pages, $post, $args, $instance, $asm );
 
226
 
227
  #---- if there are no children do not display the parent unless it is check to do so
228
  if( (!empty($child_pages)) || $asm->checked('include_childless_parent') && (!in_array($top_parent, $exclude) ) ){