Advanced Sidebar Menu - Version 7.4.4

Version Description

Download this release

Release Info

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

Code changes from version 7.4.3 to 7.4.4

advanced-sidebar-menu.php CHANGED
@@ -4,7 +4,7 @@
4
* Plugin URI: https://matlipe.com/advanced-sidebar-menu/
5
* Description: Creates dynamic menus based on parent/child relationship of your pages or categories.
6
* Author: Mat Lipe
7
- * Version: 7.4.3
8
* Author URI: https://matlipe.com
9
* Text Domain: advanced-sidebar-menu
10
*
@@ -15,7 +15,7 @@ if ( defined( 'ADVANCED_SIDEBAR_BASIC_VERSION' ) ) {
15
return;
16
}
17
18
- define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '7.4.3' );
19
define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
20
21
if ( ! function_exists( 'advanced_sidebar_menu_load' ) ) {
4
* Plugin URI: https://matlipe.com/advanced-sidebar-menu/
5
* Description: Creates dynamic menus based on parent/child relationship of your pages or categories.
6
* Author: Mat Lipe
7
+ * Version: 7.4.4
8
* Author URI: https://matlipe.com
9
* Text Domain: advanced-sidebar-menu
10
*
15
return;
16
}
17
18
+ define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '7.4.4' );
19
define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
20
21
if ( ! function_exists( 'advanced_sidebar_menu_load' ) ) {
readme.txt CHANGED
@@ -3,10 +3,10 @@
3
Contributors: Mat Lipe
4
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40matlipe%2ecom&lc=US&item_name=Advanced%20Sidebar%20Menu&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
5
Tags: menus, sidebar menu, hierarchy, category menu, pages menu
6
- Requires at least: 4.6.0
7
- Tested up to: 5.0.0
8
Requires PHP: 5.2.4
9
- Stable tag: 7.4.3
10
11
== Description ==
12
@@ -16,7 +16,7 @@ Keeps the menu clean and usable. Only related items display so you don't have to
16
17
<strong>Check out <a href="https://matlipe.com/product/advanced-sidebar-menu-pro/">Advanced Sidebar Menu Pro</a> for more features including priority support, the ability to customize the look and feel, custom link text, excluding of pages, category ordering, accordions, custom post types, custom taxonomies, and so much more!</strong>
18
19
- <blockquote><a href="https://matlipe.com/product/advanced-sidebar-menu-pro/" target="_blank">Pro version 3.3.0</a> just dropped with support for custom navigation menus from Appearance -> Menus!</blockquote>
20
21
<h4>Features</h4>
22
* Page and Category widgets.
3
Contributors: Mat Lipe
4
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40matlipe%2ecom&lc=US&item_name=Advanced%20Sidebar%20Menu&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
5
Tags: menus, sidebar menu, hierarchy, category menu, pages menu
6
+ Requires at least: 4.7.0
7
+ Tested up to: 5.0.2
8
Requires PHP: 5.2.4
9
+ Stable tag: 7.4.4
10
11
== Description ==
12
16
17
<strong>Check out <a href="https://matlipe.com/product/advanced-sidebar-menu-pro/">Advanced Sidebar Menu Pro</a> for more features including priority support, the ability to customize the look and feel, custom link text, excluding of pages, category ordering, accordions, custom post types, custom taxonomies, and so much more!</strong>
18
19
+ <blockquote><a href="https://matlipe.com/product/advanced-sidebar-menu-pro/" target="_blank">Pro version 3.4.0</a> is now available with support for Beaver Builder!</blockquote>
20
21
<h4>Features</h4>
22
* Page and Category widgets.
src/Widget/Page.php CHANGED
@@ -8,17 +8,16 @@
8
*
9
* @author Mat Lipe
10
* @since 7.0.0
11
- *
12
*/
13
class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__Widget {
14
- const TITLE = Advanced_Sidebar_Menu_Menus_Abstract::TITLE;
15
- const INCLUDE_PARENT = Advanced_Sidebar_Menu_Menus_Abstract::INCLUDE_PARENT;
16
const INCLUDE_CHILDLESS_PARENT = Advanced_Sidebar_Menu_Menus_Abstract::INCLUDE_CHILDLESS_PARENT;
17
- const ORDER_BY = Advanced_Sidebar_Menu_Menus_Abstract::ORDER_BY;
18
- const USE_PLUGIN_STYLES = Advanced_Sidebar_Menu_Menus_Abstract::USE_PLUGIN_STYLES;
19
- const EXCLUDE = Advanced_Sidebar_Menu_Menus_Abstract::EXCLUDE;
20
- const DISPLAY_ALL = Advanced_Sidebar_Menu_Menus_Abstract::DISPLAY_ALL;
21
- const LEVELS = Advanced_Sidebar_Menu_Menus_Abstract::LEVELS;
22
23
protected static $defaults = array(
24
self::TITLE => false,
@@ -99,9 +98,7 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
99
</label>
100
</p>
101
102
- <div
103
- data-js="<?php echo esc_attr( $widget->get_field_id( self::LEVELS ) ); ?>"
104
- <?php $widget->hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>
105
<p>
106
<label>
107
<?php esc_html_e( 'Levels to display', 'advanced-sidebar-menu' ); ?>:</label>
@@ -168,11 +165,14 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
168
id="<?php echo esc_attr( $widget->get_field_id( self::ORDER_BY ) ); ?>"
169
name="<?php echo esc_attr( $widget->get_field_name( self::ORDER_BY ) ); ?>">
170
<?php
171
- $order_by = (array) apply_filters( 'advanced-sidebar-menu/widget/page/order-by-options', array(
172
- 'menu_order' => 'Page Order',
173
- 'post_title' => 'Title',
174
- 'post_date' => 'Published Date',
175
- ) );
176
177
foreach ( $order_by as $key => $order ) {
178
printf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $instance[ self::ORDER_BY ], $key, false ), esc_html( $order ) );
@@ -255,7 +255,7 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
255
<div class="advanced-sidebar-menu-column advanced-sidebar-menu-column-right">
256
<?php
257
258
- //@deprecated action
259
do_action( 'advanced_sidebar_menu_after_widget_form', $instance, $this );
260
261
do_action( 'advanced-sidebar-menu/widget/page/right-column', $instance, $this );
8
*
9
* @author Mat Lipe
10
* @since 7.0.0
11
*/
12
class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__Widget {
13
+ const TITLE = Advanced_Sidebar_Menu_Menus_Abstract::TITLE;
14
+ const INCLUDE_PARENT = Advanced_Sidebar_Menu_Menus_Abstract::INCLUDE_PARENT;
15
const INCLUDE_CHILDLESS_PARENT = Advanced_Sidebar_Menu_Menus_Abstract::INCLUDE_CHILDLESS_PARENT;
16
+ const ORDER_BY = Advanced_Sidebar_Menu_Menus_Abstract::ORDER_BY;
17
+ const USE_PLUGIN_STYLES = Advanced_Sidebar_Menu_Menus_Abstract::USE_PLUGIN_STYLES;
18
+ const EXCLUDE = Advanced_Sidebar_Menu_Menus_Abstract::EXCLUDE;
19
+ const DISPLAY_ALL = Advanced_Sidebar_Menu_Menus_Abstract::DISPLAY_ALL;
20
+ const LEVELS = Advanced_Sidebar_Menu_Menus_Abstract::LEVELS;
21
22
protected static $defaults = array(
23
self::TITLE => false,
98
</label>
99
</p>
100
101
+ <div <?php $widget->hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>
102
<p>
103
<label>
104
<?php esc_html_e( 'Levels to display', 'advanced-sidebar-menu' ); ?>:</label>
165
id="<?php echo esc_attr( $widget->get_field_id( self::ORDER_BY ) ); ?>"
166
name="<?php echo esc_attr( $widget->get_field_name( self::ORDER_BY ) ); ?>">
167
<?php
168
+ $order_by = (array) apply_filters(
169
+ 'advanced-sidebar-menu/widget/page/order-by-options',
170
+ array(
171
+ 'menu_order' => 'Page Order',
172
+ 'post_title' => 'Title',
173
+ 'post_date' => 'Published Date',
174
+ )
175
+ );
176
177
foreach ( $order_by as $key => $order ) {
178
printf( '<option value="%s" %s>%s</option>', esc_attr( $key ), selected( $instance[ self::ORDER_BY ], $key, false ), esc_html( $order ) );
255
<div class="advanced-sidebar-menu-column advanced-sidebar-menu-column-right">
256
<?php
257
258
+ // @deprecated action
259
do_action( 'advanced_sidebar_menu_after_widget_form', $instance, $this );
260
261
do_action( 'advanced-sidebar-menu/widget/page/right-column', $instance, $this );
src/Widget/Widget.php CHANGED
@@ -55,27 +55,27 @@ abstract class Advanced_Sidebar_Menu__Widget__Widget extends WP_Widget {
55
56
57
/**
58
- * Hide an reveal_element if a checkbox is checked.
59
*
60
- * @param string $checkbox - name of checkbox reveal_element which controls this one.
61
- * @param string $reveal_element - match the reveal element passed to checkbox which reveals this.
62
- * @param bool $reverse - hide on check instead of show on check.
63
*
64
- * @todo Convert all uses of this method to supply the $reveal_element
65
*
66
* @since 7.2.0
67
- * @since 7.2.2 Added the `reveal_element` argument.
68
*
69
* @return void
70
*/
71
- public function hide_element( $checkbox, $reveal_element = null, $reverse = false ) {
72
$hide = false;
73
- if ( ( $reverse && $this->checked( $checkbox ) ) || ( ! $reverse && ! $this->checked( $checkbox ) ) ) {
74
$hide = true;
75
}
76
77
- if ( null !== $reveal_element ) {
78
- ?> data-js="<?php echo esc_attr( $this->get_field_id( $reveal_element ) ); ?>"
79
<?php
80
}
81
// Append the hide to a global variable so it can be picked up only if the advanced-sidebar-menu JS is present.
55
56
57
/**
58
+ * Hide an element_key if a controlling_checkbox is checked.
59
*
60
+ * @param string $controlling_checkbox - Name of controlling_checkbox field which controls whether to hide this element or not.
61
+ * @param string $element_key - Match the `element_to_reveal` passed to $this->checkbox() for the checkbox which controls this.
62
+ * @param bool $reverse - hide on check instead of show on check.
63
*
64
+ * @todo Convert all uses of this method to supply the $element_key
65
*
66
* @since 7.2.0
67
+ * @since 7.2.2 Added the `element_key` argument.
68
*
69
* @return void
70
*/
71
+ public function hide_element( $controlling_checkbox, $element_key = null, $reverse = false ) {
72
$hide = false;
73
+ if ( ( $reverse && $this->checked( $controlling_checkbox ) ) || ( ! $reverse && ! $this->checked( $controlling_checkbox ) ) ) {
74
$hide = true;
75
}
76
77
+ if ( null !== $element_key ) {
78
+ ?> data-js="<?php echo esc_attr( $this->get_field_id( $element_key ) ); ?>"
79
<?php
80
}
81
// Append the hide to a global variable so it can be picked up only if the advanced-sidebar-menu JS is present.