Dropdown Menu Widget - Version 1.5.8

Version Description

  • Added dropdown_menu_defaults filter for changing default options like order, depth etc.
Download this release

Release Info

Developer mattsay
Plugin Icon wp plugin Dropdown Menu Widget
Version 1.5.8
Comparing to
See all releases

Code changes from version 1.5.7 to 1.5.8

Files changed (2) hide show
  1. readme.txt +4 -1
  2. shailan.DropDownMenu.php +16 -10
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://shailan.com/donate
4
  Tags: css, dropdown, menu, widget, pages, categories, multi, jquery, navigation
5
  Requires at least: 2.8
6
  Tested up to: 3.0.2
7
- Stable tag: 1.5.7
8
 
9
  This widget adds a beatiful vertical/horizontal CSS only dropdown menu of Pages, Categories or Custom navigation menus of your blog.
10
 
@@ -47,6 +47,9 @@ You can submit errors and bugs using the [online form](http://shailan.com/contac
47
 
48
  == Changelog ==
49
 
 
 
 
50
  = 1.5.7 =
51
  * Fixed various css issues.
52
  * Removed backgrounds for IE on certain themes.
4
  Tags: css, dropdown, menu, widget, pages, categories, multi, jquery, navigation
5
  Requires at least: 2.8
6
  Tested up to: 3.0.2
7
+ Stable tag: 1.5.8
8
 
9
  This widget adds a beatiful vertical/horizontal CSS only dropdown menu of Pages, Categories or Custom navigation menus of your blog.
10
 
47
 
48
  == Changelog ==
49
 
50
+ = 1.5.8 =
51
+ * Added dropdown_menu_defaults filter for changing default options like order, depth etc.
52
+
53
  = 1.5.7 =
54
  * Fixed various css issues.
55
  * Removed backgrounds for IE on certain themes.
shailan.DropDownMenu.php CHANGED
@@ -4,13 +4,13 @@ Plugin Name: Dropdown Menu Widget
4
  Plugin URI: http://shailan.com/wordpress/plugins/dropdown-menu
5
  Description: A multi widget to generate drop-down menus from your pages, categories & navigation menus. You can find more widgets, plugins and themes at <a href="http://shailan.com">shailan.com</a>.
6
  Tags: dropdown, menu, css, css-dropdown, navigation, widget, dropdown-menu, customization, theme
7
- Version: 1.5.7
8
  Author: Matt Say
9
  Author URI: http://shailan.com
10
  Text Domain: shailan-dropdown-menu
11
  */
12
 
13
- define('SHAILAN_DM_VERSION','1.5.7');
14
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
15
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
16
 
@@ -355,14 +355,18 @@ class shailan_DropdownWidget extends WP_Widget {
355
  </div>';
356
 
357
  $dropdown_wrapper_close = '</div> ';
358
-
359
  $menu_defaults = array(
360
- 'order_by'=>'name',
361
- 'depth'=>'4',
362
- 'title_li'=>'',
363
- 'exclude'=>$exclude
 
 
364
  );
365
-
 
 
366
  switch ( $type ) {
367
 
368
  /** Pages menu */
@@ -625,7 +629,7 @@ add_action('admin_menu', array('shailan_DropdownWidget', 'adminMenu'));
625
  include('shailan-multi-dropdown.php'); // Load multi-dropdown widget
626
 
627
  // template tag support
628
- function shailan_dropdown_menu(){
629
  $type = get_option('shailan_dm_type');
630
  $exclude = get_option('shailan_dm_exclude');
631
  $inline_style = get_option('shailan_dm_style');
@@ -635,7 +639,7 @@ function shailan_dropdown_menu(){
635
  $home = (bool) get_option('shailan_dm_home');
636
  $align = get_option('shailan_dm_align');
637
 
638
- $args = array(
639
  'type' => $type,
640
  'exclude' => $exclude,
641
  'style' => $inline_style,
@@ -645,6 +649,8 @@ function shailan_dropdown_menu(){
645
  'home' => $home,
646
  'align' => $align
647
  );
 
 
648
 
649
  the_widget('shailan_DropdownWidget', $args);
650
  }
4
  Plugin URI: http://shailan.com/wordpress/plugins/dropdown-menu
5
  Description: A multi widget to generate drop-down menus from your pages, categories & navigation menus. You can find more widgets, plugins and themes at <a href="http://shailan.com">shailan.com</a>.
6
  Tags: dropdown, menu, css, css-dropdown, navigation, widget, dropdown-menu, customization, theme
7
+ Version: 1.5.8
8
  Author: Matt Say
9
  Author URI: http://shailan.com
10
  Text Domain: shailan-dropdown-menu
11
  */
12
 
13
+ define('SHAILAN_DM_VERSION','1.5.8');
14
  define('SHAILAN_DM_TITLE', 'Dropdown Menu');
15
  define('SHAILAN_DM_FOLDER', 'dropdown-menu-widget');
16
 
355
  </div>';
356
 
357
  $dropdown_wrapper_close = '</div> ';
358
+
359
  $menu_defaults = array(
360
+ 'ID' => $this->number,
361
+ 'sort_column' => 'menu_order, post_title',
362
+ 'order_by' => 'name',
363
+ 'depth' => '4',
364
+ 'title_li' => '',
365
+ 'exclude' => $exclude
366
  );
367
+
368
+ $menu_defaults = apply_filters( 'dropdown_menu_defaults', $menu_defaults );
369
+
370
  switch ( $type ) {
371
 
372
  /** Pages menu */
629
  include('shailan-multi-dropdown.php'); // Load multi-dropdown widget
630
 
631
  // template tag support
632
+ function shailan_dropdown_menu( $args = array() ){
633
  $type = get_option('shailan_dm_type');
634
  $exclude = get_option('shailan_dm_exclude');
635
  $inline_style = get_option('shailan_dm_style');
639
  $home = (bool) get_option('shailan_dm_home');
640
  $align = get_option('shailan_dm_align');
641
 
642
+ $opts = array(
643
  'type' => $type,
644
  'exclude' => $exclude,
645
  'style' => $inline_style,
649
  'home' => $home,
650
  'align' => $align
651
  );
652
+
653
+ $args = array_merge( $args, $opts );
654
 
655
  the_widget('shailan_DropdownWidget', $args);
656
  }