Advanced Sidebar Menu - Version 7.4.0

Version Description

  • Added support for Beaver Builder
Download this release

Release Info

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

Code changes from version 7.3.1 to 7.4.0

advanced-sidebar-menu.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Advanced Sidebar Menu
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.3.1
8
Author URI: https://matlipe.com
9
Text Domain: advanced-sidebar-menu
10
*/
@@ -14,7 +14,7 @@ if ( defined( 'ADVANCED_SIDEBAR_BASIC_VERSION' ) ) {
14
return;
15
}
16
17
- define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '7.3.1' );
18
define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
19
20
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.0
8
Author URI: https://matlipe.com
9
Text Domain: advanced-sidebar-menu
10
*/
14
return;
15
}
16
17
+ define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '7.4.0' );
18
define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
19
20
if ( ! function_exists( 'advanced_sidebar_menu_load' ) ) {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: menus, sidebar menu, hierarchy, category menu, pages menu
6
Requires at least: 4.6.0
7
Tested up to: 4.9.8
8
Requires PHP: 5.2.4
9
- Stable tag: 7.3.1
10
11
== Description ==
12
@@ -149,6 +149,9 @@ Yes. Based on whatever page, post, or category you are on, the menu will change
149
150
151
== Changelog ==
152
= 7.3.0 =
153
* Greatly improve category widget performance
154
@@ -225,6 +228,9 @@ Yes. Based on whatever page, post, or category you are on, the menu will change
225
226
227
== Upgrade Notice ==
228
= 7.2.2 =
229
Update to support PRO version 3.2.0
230
6
Requires at least: 4.6.0
7
Tested up to: 4.9.8
8
Requires PHP: 5.2.4
9
+ Stable tag: 7.4.0
10
11
== Description ==
12
149
150
151
== Changelog ==
152
+ = 7.4.0 =
153
+ * Added support for Beaver Builder
154
+
155
= 7.3.0 =
156
* Greatly improve category widget performance
157
228
229
230
== Upgrade Notice ==
231
+ = 7.4.0 =
232
+ Update to support PRO version 3.4.0
233
+
234
= 7.2.2 =
235
Update to support PRO version 3.2.0
236
src/Widget/Category.php CHANGED
@@ -53,43 +53,54 @@ class Advanced_Sidebar_Menu_Widget_Category extends Advanced_Sidebar_Menu__Widge
53
}
54
}
55
56
-
57
protected function hook() {
58
- add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_display' ), 5, 1 );
59
- add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_styles' ), 10, 1 );
60
- add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_singles' ), 15, 1 );
61
- add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_exclude' ), 20, 1 );
62
63
}
64
65
-
66
- public function box_display( array $instance ) {
67
?>
68
<div class="advanced-sidebar-menu-column-box">
69
<p>
70
- <?php $this->checkbox( self::INCLUDE_PARENT ); ?>
71
<label>
72
<?php esc_html_e( 'Display highest level parent category', 'advanced-sidebar-menu' ); ?>
73
</label>
74
</p>
75
<p>
76
- <?php $this->checkbox( self::INCLUDE_CHILDLESS_PARENT ); ?>
77
<label>
78
<?php esc_html_e( 'Display menu when there is only the parent category', 'advanced-sidebar-menu' ); ?>
79
</label>
80
</p>
81
<p>
82
- <?php $this->checkbox( self::DISPLAY_ALL, self::LEVELS ); ?>
83
<label>
84
<?php esc_html_e( 'Always display child categories', 'advanced-sidebar-menu' ); ?>
85
</label>
86
</p>
87
- <div <?php $this->hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>
88
<p>
89
<label>
90
<?php esc_html_e( 'Levels to display', 'advanced-sidebar-menu' ); ?>:</label>
91
<select
92
- name="<?php echo esc_attr( $this->get_field_name( self::LEVELS ) ); ?>">
93
<?php
94
for ( $i = 1; $i < 6; $i ++ ) {
95
?>
@@ -105,46 +116,58 @@ class Advanced_Sidebar_Menu_Widget_Category extends Advanced_Sidebar_Menu__Widge
105
</p>
106
</div>
107
108
- <?php do_action( 'advanced-sidebar-menu/widget/category/display-box', $instance, $this ); ?>
109
110
</div>
111
<?php
112
}
113
114
-
115
- public function box_styles( array $instance ) {
116
?>
117
<div class="advanced-sidebar-menu-column-box">
118
<p>
119
- <?php $this->checkbox( self::USE_PLUGIN_STYLES ); ?>
120
<label>
121
<?php esc_html_e( "Use this plugin's default styling", 'advanced-sidebar-menu' ); ?>
122
</label>
123
</p>
124
125
- <?php do_action( 'advanced-sidebar-menu/widget/category/styles-box', $instance, $this ); ?>
126
</div>
127
<?php
128
}
129
130
-
131
- public function box_singles( array $instance ) {
132
?>
133
<div class="advanced-sidebar-menu-column-box">
134
<p>
135
136
- <?php $this->checkbox( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>
137
<label>
138
<?php esc_html_e( 'Display categories on single posts', 'advanced-sidebar-menu' ); ?>
139
</label>
140
</p>
141
142
- <div <?php $this->hide_element( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>>
143
<p>
144
<label><?php esc_html_e( "Display each single post's category", 'advanced-sidebar-menu' ); ?>
145
:</label>
146
<select
147
- name="<?php echo esc_attr( $this->get_field_name( self::EACH_CATEGORY_DISPLAY ) ); ?>">
148
<option
149
value="widget" <?php selected( 'widget', $instance[ self::EACH_CATEGORY_DISPLAY ] ); ?>>
150
<?php esc_html_e( 'In a new widget', 'advanced-sidebar-menu' ); ?>
@@ -156,14 +179,20 @@ class Advanced_Sidebar_Menu_Widget_Category extends Advanced_Sidebar_Menu__Widge
156
</p>
157
</div>
158
159
- <?php do_action( 'advanced-sidebar-menu/widget/category/singles-box', $instance, $this ); ?>
160
161
</div>
162
<?php
163
}
164
165
-
166
- public function box_exclude( array $instance ) {
167
?>
168
<div class="advanced-sidebar-menu-column-box">
169
<p>
@@ -171,15 +200,15 @@ class Advanced_Sidebar_Menu_Widget_Category extends Advanced_Sidebar_Menu__Widge
171
<?php esc_html_e( 'Categories to exclude (ids), comma separated', 'advanced-sidebar-menu' ); ?>:
172
</label>
173
<input
174
- id="<?php echo esc_attr( $this->get_field_id( self::EXCLUDE ) ); ?>"
175
- name="<?php echo esc_attr( $this->get_field_name( self::EXCLUDE ) ); ?>"
176
type="text"
177
class="widefat"
178
value="<?php echo esc_attr( $instance[ self::EXCLUDE ] ); ?>"/>
179
</p>
180
181
<?php
182
- do_action( 'advanced-sidebar-menu/widget/category/exclude-box', $instance, $this );
183
?>
184
</div>
185
<?php
53
}
54
}
55
56
+ /**
57
+ * @notice Anything using the column actions must use the $widget class passed
58
+ * via do_action instead of $this
59
+ *
60
+ * @return void
61
+ */
62
protected function hook() {
63
+ add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_display' ), 5, 2 );
64
+ add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_styles' ), 10, 2 );
65
+ add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_singles' ), 15, 2 );
66
+ add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_exclude' ), 20, 2 );
67
68
}
69
70
+ /**
71
+ *
72
+ * @param array $instance
73
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
74
+ *
75
+ * @return void
76
+ */
77
+ public function box_display( array $instance, $widget ) {
78
?>
79
<div class="advanced-sidebar-menu-column-box">
80
<p>
81
+ <?php $widget->checkbox( self::INCLUDE_PARENT ); ?>
82
<label>
83
<?php esc_html_e( 'Display highest level parent category', 'advanced-sidebar-menu' ); ?>
84
</label>
85
</p>
86
<p>
87
+ <?php $widget->checkbox( self::INCLUDE_CHILDLESS_PARENT ); ?>
88
<label>
89
<?php esc_html_e( 'Display menu when there is only the parent category', 'advanced-sidebar-menu' ); ?>
90
</label>
91
</p>
92
<p>
93
+ <?php $widget->checkbox( self::DISPLAY_ALL, self::LEVELS ); ?>
94
<label>
95
<?php esc_html_e( 'Always display child categories', 'advanced-sidebar-menu' ); ?>
96
</label>
97
</p>
98
+ <div <?php $widget->hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>
99
<p>
100
<label>
101
<?php esc_html_e( 'Levels to display', 'advanced-sidebar-menu' ); ?>:</label>
102
<select
103
+ name="<?php echo esc_attr( $widget->get_field_name( self::LEVELS ) ); ?>">
104
<?php
105
for ( $i = 1; $i < 6; $i ++ ) {
106
?>
116
</p>
117
</div>
118
119
+ <?php do_action( 'advanced-sidebar-menu/widget/category/display-box', $instance, $widget ); ?>
120
121
</div>
122
<?php
123
}
124
125
+ /**
126
+ *
127
+ * @param array $instance
128
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
129
+ *
130
+ * @return void
131
+ */
132
+ public function box_styles( array $instance, $widget ) {
133
?>
134
<div class="advanced-sidebar-menu-column-box">
135
<p>
136
+ <?php $widget->checkbox( self::USE_PLUGIN_STYLES ); ?>
137
<label>
138
<?php esc_html_e( "Use this plugin's default styling", 'advanced-sidebar-menu' ); ?>
139
</label>
140
</p>
141
142
+ <?php do_action( 'advanced-sidebar-menu/widget/category/styles-box', $instance, $widget ); ?>
143
</div>
144
<?php
145
}
146
147
+ /**
148
+ *
149
+ * @param array $instance
150
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
151
+ *
152
+ * @return void
153
+ */
154
+ public function box_singles( array $instance, $widget ) {
155
?>
156
<div class="advanced-sidebar-menu-column-box">
157
<p>
158
159
+ <?php $widget->checkbox( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>
160
<label>
161
<?php esc_html_e( 'Display categories on single posts', 'advanced-sidebar-menu' ); ?>
162
</label>
163
</p>
164
165
+ <div <?php $widget->hide_element( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>>
166
<p>
167
<label><?php esc_html_e( "Display each single post's category", 'advanced-sidebar-menu' ); ?>
168
:</label>
169
<select
170
+ name="<?php echo esc_attr( $widget->get_field_name( self::EACH_CATEGORY_DISPLAY ) ); ?>">
171
<option
172
value="widget" <?php selected( 'widget', $instance[ self::EACH_CATEGORY_DISPLAY ] ); ?>>
173
<?php esc_html_e( 'In a new widget', 'advanced-sidebar-menu' ); ?>
179
</p>
180
</div>
181
182
+ <?php do_action( 'advanced-sidebar-menu/widget/category/singles-box', $instance, $widget ); ?>
183
184
</div>
185
<?php
186
}
187
188
+ /**
189
+ *
190
+ * @param array $instance
191
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
192
+ *
193
+ * @return void
194
+ */
195
+ public function box_exclude( array $instance, $widget ) {
196
?>
197
<div class="advanced-sidebar-menu-column-box">
198
<p>
200
<?php esc_html_e( 'Categories to exclude (ids), comma separated', 'advanced-sidebar-menu' ); ?>:
201
</label>
202
<input
203
+ id="<?php echo esc_attr( $widget->get_field_id( self::EXCLUDE ) ); ?>"
204
+ name="<?php echo esc_attr( $widget->get_field_name( self::EXCLUDE ) ); ?>"
205
type="text"
206
class="widefat"
207
value="<?php echo esc_attr( $instance[ self::EXCLUDE ] ); ?>"/>
208
</p>
209
210
<?php
211
+ do_action( 'advanced-sidebar-menu/widget/category/exclude-box', $instance, $widget );
212
?>
213
</div>
214
<?php
src/Widget/Page.php CHANGED
@@ -53,20 +53,32 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
53
}
54
55
56
protected function hook() {
57
- add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_display' ), 5, 1 );
58
- add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_styles' ), 10, 1 );
59
- add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_order' ), 15, 1 );
60
- add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_exclude' ), 20, 1 );
61
62
}
63
64
-
65
- public function box_display( array $instance ) {
66
?>
67
<div class="advanced-sidebar-menu-column-box">
68
<p>
69
- <?php $this->checkbox( self::INCLUDE_PARENT ); ?>
70
<label>
71
<?php esc_html_e( 'Display highest level parent page', 'advanced-sidebar-menu' ); ?>
72
</label>
@@ -74,27 +86,27 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
74
75
76
<p>
77
- <?php $this->checkbox( self::INCLUDE_CHILDLESS_PARENT ); ?>
78
<label>
79
<?php esc_html_e( 'Display menu when there is only the parent page', 'advanced-sidebar-menu' ); ?>
80
</label>
81
</p>
82
83
<p>
84
- <?php $this->checkbox( self::DISPLAY_ALL, self::LEVELS ); ?>
85
<label>
86
<?php esc_html_e( 'Always display child pages', 'advanced-sidebar-menu' ); ?>
87
</label>
88
</p>
89
90
<div
91
- data-js="<?php echo esc_attr( $this->get_field_id( self::LEVELS ) ); ?>"
92
- <?php $this->hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>
93
<p>
94
<label>
95
<?php esc_html_e( 'Levels to display', 'advanced-sidebar-menu' ); ?>:</label>
96
<select
97
- name="<?php echo esc_attr( $this->get_field_name( self::LEVELS ) ); ?>">
98
<?php
99
for ( $i = 1; $i < 6; $i ++ ) {
100
?>
@@ -110,29 +122,41 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
110
</p>
111
</div>
112
113
- <?php do_action( 'advanced-sidebar-menu/widget/page/display-box', $instance, $this ); ?>
114
115
</div>
116
<?php
117
}
118
119
-
120
- public function box_styles( array $instance ) {
121
?>
122
<div class="advanced-sidebar-menu-column-box">
123
<p>
124
- <?php $this->checkbox( self::USE_PLUGIN_STYLES ); ?>
125
<label>
126
<?php esc_html_e( "Use this plugin's default styling", 'advanced-sidebar-menu' ); ?>
127
</label>
128
</p>
129
- <?php do_action( 'advanced-sidebar-menu/widget/page/styles-box', $instance, $this ); ?>
130
</div>
131
<?php
132
}
133
134
-
135
- public function box_order( array $instance ) {
136
?>
137
<div class="advanced-sidebar-menu-column-box">
138
@@ -141,8 +165,8 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
141
<?php esc_html_e( 'Order by', 'advanced-sidebar-menu' ); ?>:
142
</label>
143
<select
144
- id="<?php echo esc_attr( $this->get_field_id( self::ORDER_BY ) ); ?>"
145
- name="<?php echo esc_attr( $this->get_field_name( self::ORDER_BY ) ); ?>">
146
<?php
147
$order_by = (array) apply_filters( 'advanced-sidebar-menu/widget/page/order-by-options', array(
148
'menu_order' => 'Page Order',
@@ -156,14 +180,20 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
156
?>
157
</select>
158
</p>
159
- <?php do_action( 'advanced-sidebar-menu/widget/page/order-box', $instance, $this ); ?>
160
161
</div>
162
<?php
163
}
164
165
-
166
- public function box_exclude( array $instance ) {
167
?>
168
<div class="advanced-sidebar-menu-column-box">
169
<p>
@@ -171,14 +201,14 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
171
<?php esc_html_e( 'Pages to exclude (ids), comma separated', 'advanced-sidebar-menu' ); ?>:
172
</label>
173
<input
174
- id="<?php echo esc_attr( $this->get_field_id( self::EXCLUDE ) ); ?>"
175
- name="<?php echo esc_attr( $this->get_field_name( self::EXCLUDE ) ); ?>"
176
class="widefat"
177
type="text"
178
value="<?php echo esc_attr( $instance[ self::EXCLUDE ] ); ?>"/>
179
</p>
180
<?php
181
- do_action( 'advanced-sidebar-menu/widget/page/exclude-box', $instance, $this );
182
?>
183
</div>
184
<?php
@@ -210,7 +240,7 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
210
type="text"
211
value="<?php echo esc_attr( $instance[ self::TITLE ] ); ?>"/>
212
</p>
213
- <div class="advanced-sidebar-menu-column">
214
<?php
215
do_action( 'advanced-sidebar-menu/widget/page/left-column', $instance, $this );
216
if ( has_action( 'advanced_sidebar_menu_page_widget_form' ) ) {
@@ -246,7 +276,9 @@ class Advanced_Sidebar_Menu_Widget_Page extends Advanced_Sidebar_Menu__Widget__W
246
* @return array|mixed
247
*/
248
public function update( $new_instance, $old_instance ) {
249
- $new_instance['exclude'] = strip_tags( $new_instance['exclude'] );
250
251
return apply_filters( 'advanced_sidebar_menu_page_widget_update', $new_instance, $old_instance );
252
}
53
}
54
55
56
+ /**
57
+ * @notice Anything using the column actions must use the $widget class passed
58
+ * via do_action instead of $this
59
+ *
60
+ * @return void
61
+ */
62
protected function hook() {
63
+ add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_display' ), 5, 2 );
64
+ add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_styles' ), 10, 2 );
65
+ add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_order' ), 15, 2 );
66
+ add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_exclude' ), 20, 2 );
67
68
}
69
70
+ /**
71
+ *
72
+ * @param array $instance
73
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
74
+ *
75
+ * @return void
76
+ */
77
+ public function box_display( array $instance, $widget ) {
78
?>
79
<div class="advanced-sidebar-menu-column-box">
80
<p>
81
+ <?php $widget->checkbox( self::INCLUDE_PARENT ); ?>
82
<label>
83
<?php esc_html_e( 'Display highest level parent page', 'advanced-sidebar-menu' ); ?>
84
</label>
86
87
88
<p>
89
+ <?php $widget->checkbox( self::INCLUDE_CHILDLESS_PARENT ); ?>
90
<label>
91
<?php esc_html_e( 'Display menu when there is only the parent page', 'advanced-sidebar-menu' ); ?>
92
</label>
93
</p>
94
95
<p>
96
+ <?php $widget->checkbox( self::DISPLAY_ALL, self::LEVELS ); ?>
97
<label>
98
<?php esc_html_e( 'Always display child pages', 'advanced-sidebar-menu' ); ?>
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>
108
<select
109
+ name="<?php echo esc_attr( $widget->get_field_name( self::LEVELS ) ); ?>">
110
<?php
111
for ( $i = 1; $i < 6; $i ++ ) {
112
?>
122
</p>
123
</div>
124
125
+ <?php do_action( 'advanced-sidebar-menu/widget/page/display-box', $instance, $widget ); ?>
126
127
</div>
128
<?php
129
}
130
131
+ /**
132
+ *
133
+ * @param array $instance
134
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
135
+ *
136
+ * @return void
137
+ */
138
+ public function box_styles( array $instance, $widget ) {
139
?>
140
<div class="advanced-sidebar-menu-column-box">
141
<p>
142
+ <?php $widget->checkbox( self::USE_PLUGIN_STYLES ); ?>
143
<label>
144
<?php esc_html_e( "Use this plugin's default styling", 'advanced-sidebar-menu' ); ?>
145
</label>
146
</p>
147
+ <?php do_action( 'advanced-sidebar-menu/widget/page/styles-box', $instance, $widget ); ?>
148
</div>
149
<?php
150
}
151
152
+ /**
153
+ *
154
+ * @param array $instance
155
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
156
+ *
157
+ * @return void
158
+ */
159
+ public function box_order( array $instance, $widget ) {
160
?>
161
<div class="advanced-sidebar-menu-column-box">
162
165
<?php esc_html_e( 'Order by', 'advanced-sidebar-menu' ); ?>:
166
</label>
167
<select
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',
180
?>
181
</select>
182
</p>
183
+ <?php do_action( 'advanced-sidebar-menu/widget/page/order-box', $instance, $widget ); ?>
184
185
</div>
186
<?php
187
}
188
189
+ /**
190
+ *
191
+ * @param array $instance
192
+ * @param \Advanced_Sidebar_Menu__Widget__Widget $widget
193
+ *
194
+ * @return void
195
+ */
196
+ public function box_exclude( array $instance, $widget ) {
197
?>
198
<div class="advanced-sidebar-menu-column-box">
199
<p>
201
<?php esc_html_e( 'Pages to exclude (ids), comma separated', 'advanced-sidebar-menu' ); ?>:
202
</label>
203
<input
204
+ id="<?php echo esc_attr( $widget->get_field_id( self::EXCLUDE ) ); ?>"
205
+ name="<?php echo esc_attr( $widget->get_field_name( self::EXCLUDE ) ); ?>"
206
class="widefat"
207
type="text"
208
value="<?php echo esc_attr( $instance[ self::EXCLUDE ] ); ?>"/>
209
</p>
210
<?php
211
+ do_action( 'advanced-sidebar-menu/widget/page/exclude-box', $instance, $widget );
212
?>
213
</div>
214
<?php
240
type="text"
241
value="<?php echo esc_attr( $instance[ self::TITLE ] ); ?>"/>
242
</p>
243
+ <div class="advanced-sidebar-menu-column advanced-sidebar-menu-column-left">
244
<?php
245
do_action( 'advanced-sidebar-menu/widget/page/left-column', $instance, $this );
246
if ( has_action( 'advanced_sidebar_menu_page_widget_form' ) ) {
276
* @return array|mixed
277
*/
278
public function update( $new_instance, $old_instance ) {
279
+ if ( isset( $new_instance['exclude'] ) ) {
280
+ $new_instance['exclude'] = wp_strip_all_tags( $new_instance['exclude'] );
281
+ }
282
283
return apply_filters( 'advanced_sidebar_menu_page_widget_update', $new_instance, $old_instance );
284
}
src/Widget/Widget.php CHANGED
@@ -15,7 +15,7 @@ abstract class Advanced_Sidebar_Menu__Widget__Widget extends WP_Widget {
15
/**
16
* Store the instance to this class.
17
* We do this manually because there are filters etc which
18
- * hit the instance before we get in in self::form() and self::widget()
19
*
20
* @see WP_Widget::form_callback()
21
*
15
/**
16
* Store the instance to this class.
17
* We do this manually because there are filters etc which
18
+ * hit the instance before we get to self::form() and self::widget()
19
*
20
* @see WP_Widget::form_callback()
21
*