Advanced Sidebar Menu - Version 8.8.1

Version Description

  • Introduced advanced-sidebar-menu/menus/page/is-excluded filter.
  • Introduced advanced-sidebar-menu/menus/category/is-excluded filter.
  • Tested to WordPress Core 6.0.0.
  • Required PRO version 8.7.0+.
Download this release

Release Info

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

Code changes from version 8.8.0 to 8.8.1

advanced-sidebar-menu.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://onpointplugins.com/advanced-sidebar-menu/
5
  * Description: Creates dynamic menus based on parent/child relationship of your pages or categories.
6
  * Author: OnPoint Plugins
7
- * Version: 8.8.0
8
  * Author URI: https://onpointplugins.com
9
  * Text Domain: advanced-sidebar-menu
10
  * Domain Path: /languages/
@@ -19,8 +19,8 @@ if ( defined( 'ADVANCED_SIDEBAR_BASIC_VERSION' ) ) {
19
  return;
20
  }
21
 
22
- define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '8.8.0' );
23
- define( 'ADVANCED_SIDEBAR_MENU_REQUIRED_PRO_VERSION', '8.5.0' );
24
  define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
25
  define( 'ADVANCED_SIDEBAR_MENU_URL', plugin_dir_url( __FILE__ ) );
26
 
4
  * Plugin URI: https://onpointplugins.com/advanced-sidebar-menu/
5
  * Description: Creates dynamic menus based on parent/child relationship of your pages or categories.
6
  * Author: OnPoint Plugins
7
+ * Version: 8.8.1
8
  * Author URI: https://onpointplugins.com
9
  * Text Domain: advanced-sidebar-menu
10
  * Domain Path: /languages/
19
  return;
20
  }
21
 
22
+ define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '8.8.1' );
23
+ define( 'ADVANCED_SIDEBAR_MENU_REQUIRED_PRO_VERSION', '8.7.0' );
24
  define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
25
  define( 'ADVANCED_SIDEBAR_MENU_URL', plugin_dir_url( __FILE__ ) );
26
 
readme.txt CHANGED
@@ -4,9 +4,9 @@ Contributors: Mat Lipe, onpointplugins
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40onpointplugins%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, dynamic
6
  Requires at least: 5.4.0
7
- Tested up to: 6.0.0
8
  Requires PHP: 5.6.0
9
- Stable tag: 8.8.0
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://onpointplugins.com/product/advanced-sidebar-menu-pro/">Advanced Sidebar Menu PRO</a> for more features including accordion menus, menu colors and styles, custom link text, excluding of pages, category ordering, custom post types, custom taxonomies, priority support, and so much more!</strong>
18
 
19
- <blockquote><a href="https://onpointplugins.com/product/advanced-sidebar-menu-pro/" target="_blank">PRO version 8.4.0</a> is now available with accordion options to use links for open/close!</blockquote>
20
 
21
  <h3>Features</h3>
22
  * Page and Category widgets.
@@ -133,18 +133,15 @@ For example the following CSS would:
133
  3. Add a background on hover.
134
 
135
  <code>
136
- .advanced-sidebar-menu li.current-cat a,
137
- .advanced-sidebar-menu li.current_page_item a {
138
  color: black;
139
  }
140
 
141
- .advanced-sidebar-menu li.current-cat,
142
- .advanced-sidebar-menu li.current_page_item {
143
  list-style-type: none !important;
144
  }
145
 
146
- .advanced-sidebar-menu li.current-cat > a:hover,
147
- .advanced-sidebar-menu li.current_page_item > a:hover {
148
  background: teal;
149
  }
150
  </code>
@@ -161,6 +158,18 @@ Yes. Based on whatever page, post or category you are on, the menu will change a
161
 
162
 
163
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
164
  = 8.8.0 =
165
  * Implement universal 'menu-item' style CSS classes to all menus.
166
  * Introduced `Category::is_current_top_level_term` method.
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40onpointplugins%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, dynamic
6
  Requires at least: 5.4.0
7
+ Tested up to: 6.0.1
8
  Requires PHP: 5.6.0
9
+ Stable tag: 8.8.1
10
 
11
  == Description ==
12
 
16
 
17
  <strong>Check out <a href="https://onpointplugins.com/product/advanced-sidebar-menu-pro/">Advanced Sidebar Menu PRO</a> for more features including accordion menus, menu colors and styles, custom link text, excluding of pages, category ordering, custom post types, custom taxonomies, priority support, and so much more!</strong>
18
 
19
+ <blockquote><a href="https://onpointplugins.com/product/advanced-sidebar-menu-pro/" target="_blank">PRO version 8.9.0</a> is now available with accordion options to use links for open/close!</blockquote>
20
 
21
  <h3>Features</h3>
22
  * Page and Category widgets.
133
  3. Add a background on hover.
134
 
135
  <code>
136
+ .advanced-sidebar-menu li.current-menu-item a {
 
137
  color: black;
138
  }
139
 
140
+ .advanced-sidebar-menu li.current-menu-item {
 
141
  list-style-type: none !important;
142
  }
143
 
144
+ .advanced-sidebar-menu li.current-menu-item > a:hover {
 
145
  background: teal;
146
  }
147
  </code>
158
 
159
 
160
  == Changelog ==
161
+ = 8.8.2 =
162
+ * Fixed widget id generation with block based widgets.
163
+ * Introduced `advanced-sidebar-menu/core/include-template-parts-comments` filter.
164
+ * Organized the `Menu_Abtract` class constants.
165
+ * Tested to WordPress Core 6.0.1.
166
+
167
+ = 8.8.1 =
168
+ * Introduced `advanced-sidebar-menu/menus/page/is-excluded` filter.
169
+ * Introduced `advanced-sidebar-menu/menus/category/is-excluded` filter.
170
+ * Tested to WordPress Core 6.0.0.
171
+ * Required PRO version 8.7.0+.
172
+
173
  = 8.8.0 =
174
  * Implement universal 'menu-item' style CSS classes to all menus.
175
  * Introduced `Category::is_current_top_level_term` method.
src/Menus/Menu_Abstract.php CHANGED
@@ -9,6 +9,8 @@ namespace Advanced_Sidebar_Menu\Menus;
9
  * @since 7.0.0
10
  */
11
  abstract class Menu_Abstract {
 
 
12
  const DISPLAY_ALL = 'display_all';
13
  const EXCLUDE = 'exclude';
14
  const INCLUDE_CHILDLESS_PARENT = 'include_childless_parent';
@@ -37,7 +39,7 @@ abstract class Menu_Abstract {
37
  public $instance;
38
 
39
  /**
40
- * Track the ids which have been used in case of
41
  * plugins like Elementor that we need to manually increment.
42
  *
43
  * @since 7.6.0
@@ -204,9 +206,8 @@ abstract class Menu_Abstract {
204
  * @return bool
205
  */
206
  public function is_excluded( $id ) {
207
- $exclude = $this->get_excluded_ids();
208
-
209
- return in_array( (int) $id, $exclude, true );
210
  }
211
 
212
 
@@ -216,7 +217,7 @@ abstract class Menu_Abstract {
216
  * @return array
217
  */
218
  public function get_excluded_ids() {
219
- return array_map( 'intval', array_filter( explode( ',', $this->instance[ self::EXCLUDE ] ), 'is_numeric' ) );
220
  }
221
 
222
 
@@ -242,7 +243,7 @@ abstract class Menu_Abstract {
242
  *
243
  * @static
244
  *
245
- * @var Page|Category
246
  */
247
  protected static $current;
248
 
@@ -252,7 +253,7 @@ abstract class Menu_Abstract {
252
  *
253
  * @static
254
  *
255
- * @return Page|Category
256
  */
257
  public static function get_current() {
258
  return self::$current;
9
  * @since 7.0.0
10
  */
11
  abstract class Menu_Abstract {
12
+ const WIDGET = 'menu-abstract';
13
+
14
  const DISPLAY_ALL = 'display_all';
15
  const EXCLUDE = 'exclude';
16
  const INCLUDE_CHILDLESS_PARENT = 'include_childless_parent';
39
  public $instance;
40
 
41
  /**
42
+ * Track the ids, which have been used in case of
43
  * plugins like Elementor that we need to manually increment.
44
  *
45
  * @since 7.6.0
206
  * @return bool
207
  */
208
  public function is_excluded( $id ) {
209
+ $excluded = \in_array( (int) $id, $this->get_excluded_ids(), true );
210
+ return apply_filters( 'advanced-sidebar-menu/menus/' . static::WIDGET . '/is-excluded', $excluded, $id, $this->get_widget_args(), $this->get_widget_instance(), $this );
 
211
  }
212
 
213
 
217
  * @return array
218
  */
219
  public function get_excluded_ids() {
220
+ return \array_map( 'intval', \array_filter( \explode( ',', $this->instance[ self::EXCLUDE ] ), 'is_numeric' ) );
221
  }
222
 
223
 
243
  *
244
  * @static
245
  *
246
+ * @var Page|Category|null
247
  */
248
  protected static $current;
249
 
253
  *
254
  * @static
255
  *
256
+ * @return Page|Category|null
257
  */
258
  public static function get_current() {
259
  return self::$current;
src/Traits/Memoize.php CHANGED
@@ -29,7 +29,7 @@ trait Memoize {
29
  * @param string $identifier - Something unique to identify the the method being used
30
  * so we can determine the difference in the cache.
31
  * `__METHOD__` works nicely here.
32
- * @param mixed $args - Arguments will be passed to the callback..
33
  *
34
  * @return mixed
35
  */
29
  * @param string $identifier - Something unique to identify the the method being used
30
  * so we can determine the difference in the cache.
31
  * `__METHOD__` works nicely here.
32
+ * @param mixed $args - Arguments will be passed to the callback.
33
  *
34
  * @return mixed
35
  */