Responsive Select Menu - Version 1.5.3

Version Description

  • Added UberMenu Conditionals compatibility
  • Added filterable first menu item names
Download this release

Release Info

Developer sevenspark
Plugin Icon wp plugin Responsive Select Menu
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

Files changed (3) hide show
  1. readme.md +2 -2
  2. readme.txt +7 -3
  3. responsive-select-menu.php +52 -6
readme.md CHANGED
@@ -8,9 +8,9 @@
8
 
9
  **Tags:** responsive, menu, select, drop down,
10
 
11
- **Requires at least:** 3.3
12
 
13
- **Tested up to:** 3.6
14
 
15
  **Stable tag:** trunk
16
 
8
 
9
  **Tags:** responsive, menu, select, drop down,
10
 
11
+ **Requires at least:** 3.6
12
 
13
+ **Tested up to:** 3.8
14
 
15
  **Stable tag:** trunk
16
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: sevenspark
3
  Donate link: http://bit.ly/DonateResponsiveSelect
4
  Tags: responsive, menu, select, drop down,
5
- Requires at least: 3.3
6
- Tested up to: 3.6
7
- Stable tag: 1.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,10 @@ If your theme creates a menu the standard way with wp_nav_menu, it should work.
71
 
72
  == Changelog ==
73
 
 
 
 
 
74
  = 1.5.2 =
75
  * Resolved WordPress 3.6 Strict Warnings
76
 
2
  Contributors: sevenspark
3
  Donate link: http://bit.ly/DonateResponsiveSelect
4
  Tags: responsive, menu, select, drop down,
5
+ Requires at least: 3.6
6
+ Tested up to: 3.8
7
+ Stable tag: 1.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 1.5.3 =
75
+ * Added UberMenu Conditionals compatibility
76
+ * Added filterable first menu item names
77
+
78
  = 1.5.2 =
79
  * Resolved WordPress 3.6 Strict Warnings
80
 
responsive-select-menu.php CHANGED
@@ -4,14 +4,14 @@
4
  Plugin Name: Responsive Select Menu
5
  Plugin URI: http://wpmegamenu.com/responsive-select-menu
6
  Description: Turn your menu into a select box at small viewport sizes
7
- Version: 1.5.2
8
  Author: Chris Mavricos, SevenSpark
9
  Author URI: http://sevenspark.com
10
  License: GPLv2
11
- Copyright 2011-2013 Chris Mavricos, SevenSpark http://sevenspark.com (email : chris@sevenspark.com)
12
  */
13
 
14
- define( 'RESPONSIVE_SELECT_MENU_VERSION', '1.5.2' );
15
  define( 'RESPONSIVE_SELECT_MENU_SETTINGS', 'responsive-select-menu' );
16
 
17
  require_once( 'sparkoptions/SparkOptions.class.php' ); //SevenSpark Options Panel
@@ -164,8 +164,8 @@ jQuery(document).ready( function($){
164
 
165
  $selectNav = $this->selectNavMenu( $args );
166
 
167
- $args['container_class'].= ' responsiveSelectContainer';
168
- $args['menu_class'].= ' responsiveSelectFullMenu';
169
 
170
  //This line would add a container if it doesn't exist, but has the potential to break certain theme menus
171
  //if( $args['container'] != 'nav' ) $args['container'] = 'div'; //make sure there's a container to add class to
@@ -195,7 +195,7 @@ jQuery(document).ready( function($){
195
 
196
  $itemName = $this->settings->op( 'first_item' );
197
  $selected = $this->settings->op( 'current_selected' ) ? '' : 'selected="selected"';
198
- $firstOp = '<option value="" '.$selected.'>'.$itemName.'</option>';
199
 
200
  $args['container'] = false;
201
  $args['menu_class'] = 'responsiveMenuSelect';
@@ -635,4 +635,50 @@ class ResponsiveSelectWalker extends Walker_Nav_Menu{
635
  }
636
  return isset( $this->menuItemOptions[ $item_id ][ $option_id ] ) ? stripslashes( $this->menuItemOptions[ $item_id ][ $option_id ] ) : '';
637
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  }
4
  Plugin Name: Responsive Select Menu
5
  Plugin URI: http://wpmegamenu.com/responsive-select-menu
6
  Description: Turn your menu into a select box at small viewport sizes
7
+ Version: 1.5.3
8
  Author: Chris Mavricos, SevenSpark
9
  Author URI: http://sevenspark.com
10
  License: GPLv2
11
+ Copyright 2011-2014 Chris Mavricos, SevenSpark http://sevenspark.com (email : chris@sevenspark.com)
12
  */
13
 
14
+ define( 'RESPONSIVE_SELECT_MENU_VERSION', '1.5.3' );
15
  define( 'RESPONSIVE_SELECT_MENU_SETTINGS', 'responsive-select-menu' );
16
 
17
  require_once( 'sparkoptions/SparkOptions.class.php' ); //SevenSpark Options Panel
164
 
165
  $selectNav = $this->selectNavMenu( $args );
166
 
167
+ $args['container_class'].= ($args['container_class'] == '' ? '' : ' ') . 'responsiveSelectContainer';
168
+ $args['menu_class'].= ($args['menu_class'] == '' ? '' : ' ') . 'responsiveSelectFullMenu';
169
 
170
  //This line would add a container if it doesn't exist, but has the potential to break certain theme menus
171
  //if( $args['container'] != 'nav' ) $args['container'] = 'div'; //make sure there's a container to add class to
195
 
196
  $itemName = $this->settings->op( 'first_item' );
197
  $selected = $this->settings->op( 'current_selected' ) ? '' : 'selected="selected"';
198
+ $firstOp = '<option value="" '.$selected.'>'.apply_filters( 'rsm_first_item_text' , $itemName , $args ).'</option>';
199
 
200
  $args['container'] = false;
201
  $args['menu_class'] = 'responsiveMenuSelect';
635
  }
636
  return isset( $this->menuItemOptions[ $item_id ][ $option_id ] ) ? stripslashes( $this->menuItemOptions[ $item_id ][ $option_id ] ) : '';
637
  }
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+ /* Recursive function to remove all children */
646
+ function clear_children( &$children_elements , $id ){
647
+
648
+ if( empty( $children_elements[ $id ] ) ) return;
649
+
650
+ foreach( $children_elements[ $id ] as $child ){
651
+ $this->clear_children( $children_elements , $child->ID );
652
+ }
653
+ unset( $children_elements[ $id ] );
654
+ }
655
+
656
+ /**
657
+ * Traverse elements to create list from elements.
658
+ *
659
+ * Calls parent function in UberMenuWalker.class.php
660
+ */
661
+ function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
662
+
663
+ if ( !$element )
664
+ return;
665
+
666
+ global $responsiveMenuSelect;
667
+
668
+ if( $responsiveMenuSelect->getSettings()->op( 'uber-enabled' ) ){
669
+
670
+ $id_field = $this->db_fields['id'];
671
+ $id = $element->$id_field;
672
+
673
+ $display_on = apply_filters( 'uberMenu_display_item' , true , $this , $element , $max_depth, $depth, $args );
674
+
675
+ if( !$display_on ){
676
+ $this->clear_children( $children_elements , $id );
677
+ return;
678
+ }
679
+ }
680
+
681
+ Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
682
+ //UberMenuWalker::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
683
+ }
684
  }