Advanced Sidebar Menu - Version 7.6.4

Version Description

Download this release

Release Info

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

Code changes from version 7.6.3 to 7.6.4

7.6.1/advanced-sidebar-menu.php DELETED
@@ -1,193 +0,0 @@
1
- <?php
2
- /**
3
- * 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.6.2
8
- * Author URI: https://matlipe.com
9
- * Text Domain: advanced-sidebar-menu
10
- *
11
- * @package advanced-sidebar-menu
12
- */
13
-
14
- if ( defined( 'ADVANCED_SIDEBAR_BASIC_VERSION' ) ) {
15
- return;
16
- }
17
-
18
- define( 'ADVANCED_SIDEBAR_BASIC_VERSION', '7.6.2' );
19
- define( 'ADVANCED_SIDEBAR_DIR', plugin_dir_path( __FILE__ ) );
20
-
21
- if ( ! function_exists( 'advanced_sidebar_menu_load' ) ) {
22
- /**
23
- * Load the plugin
24
- *
25
- * @return void
26
- */
27
- function advanced_sidebar_menu_load() {
28
- Advanced_Sidebar_Menu_Core::init();
29
- Advanced_Sidebar_Menu_Cache::init();
30
- Advanced_Sidebar_Menu_Debug::init();
31
- }
32
-
33
- add_action( 'plugins_loaded', 'advanced_sidebar_menu_load' );
34
- }
35
-
36
- /**
37
- * Autoload classes from PSR4 src directory
38
- * Mirrored after Composer dump-autoload for performance
39
- *
40
- * @param string $class - class being loaded.
41
- *
42
- * @return void
43
- */
44
- function advanced_sidebar_menu_autoload( $class ) {
45
- $classes = array(
46
- // widgets.
47
- 'Advanced_Sidebar_Menu__Widget__Widget' => 'Widget/Widget.php',
48
- 'Advanced_Sidebar_Menu_Widget_Page' => 'Widget/Page.php',
49
- 'Advanced_Sidebar_Menu_Widget_Category' => 'Widget/Category.php',
50
-
51
- // core.
52
- 'Advanced_Sidebar_Menu_Cache' => 'Cache.php',
53
- 'Advanced_Sidebar_Menu_Core' => 'Core.php',
54
- 'Advanced_Sidebar_Menu_Debug' => 'Debug.php',
55
- 'Advanced_Sidebar_Menu_List_Pages' => 'List_Pages.php',
56
- 'Advanced_Sidebar_Menu_Menu' => 'Menu.php',
57
- 'Advanced_Sidebar_Menu_Page_Walker' => 'Page_Walker.php',
58
-
59
- // menus.
60
- 'Advanced_Sidebar_Menu_Menus_Category' => 'Menus/Category.php',
61
- 'Advanced_Sidebar_Menu_Menus_Abstract' => 'Menus/Abstract.php',
62
- 'Advanced_Sidebar_Menu_Menus_Page' => 'Menus/Page.php',
63
- );
64
- if ( isset( $classes[ $class ] ) ) {
65
- require dirname( __FILE__ ) . '/src/' . $classes[ $class ];
66
- }
67
- }
68
-
69
- spl_autoload_register( 'advanced_sidebar_menu_autoload' );
70
-
71
-
72
- add_action( 'plugins_loaded', 'advanced_sidebar_menu_translate' );
73
- /**
74
- * Load translations
75
- *
76
- * @return void
77
- */
78
- function advanced_sidebar_menu_translate() {
79
- load_plugin_textdomain( 'advanced-sidebar-menu', false, 'advanced-sidebar-menu/languages' );
80
- }
81
-
82
- add_action( 'admin_print_scripts', 'advanced_sidebar_menu_script' );
83
- // UGH! Beaver Builder hack.
84
- if ( isset( $_GET['fl_builder'] ) ) {
85
- add_action( 'wp_enqueue_scripts', 'advanced_sidebar_menu_script' );
86
- }
87
- /**
88
- * Add js and css to the admin and in specific cases the front-end.
89
- *
90
- * @return void
91
- */
92
- function advanced_sidebar_menu_script() {
93
- wp_enqueue_script(
94
- apply_filters( 'asm_script', 'advanced-sidebar-menu-script' ),
95
- plugins_url( 'resources/js/advanced-sidebar-menu.js', __FILE__ ),
96
- array( 'jquery' ),
97
- ADVANCED_SIDEBAR_BASIC_VERSION,
98
- false
99
- );
100
-
101
- wp_enqueue_style(
102
- apply_filters( 'asm_style', 'advanced-sidebar-menu-style' ),
103
- plugins_url( 'resources/css/advanced-sidebar-menu.css', __FILE__ ),
104
- array(),
105
- ADVANCED_SIDEBAR_BASIC_VERSION
106
- );
107
- }
108
-
109
- add_action( 'advanced-sidebar-menu/widget/category/after-form', 'advanced_sidebar_menu_init_widget_js', 1000 );
110
- add_action( 'advanced-sidebar-menu/widget/page/after-form', 'advanced_sidebar_menu_init_widget_js', 1000 );
111
- add_action( 'advanced-sidebar-menu/widget/navigation-menu/after-form', 'advanced_sidebar_menu_init_widget_js', 1000 );
112
-
113
- /**
114
- * Trigger any JS needed by the widgets.
115
- * This is outputted into the markup for each widget so it may be
116
- * trigger whether the widget is loaded on the front-end by
117
- * page builders or the backend by standard WordPress or
118
- * really anywhere.
119
- *
120
- * @return void
121
- */
122
- function advanced_sidebar_menu_init_widget_js() {
123
- if ( WP_DEBUG ) {
124
- ?>
125
- <!-- <?php echo __FILE__; ?>-->
126
- <?php
127
- }
128
- ?>
129
- <script>
130
- if (typeof (advanced_sidebar_menu) !== 'undefined') {
131
- advanced_sidebar_menu.init()
132
- }
133
- </script>
134
- <?php
135
- }
136
-
137
-
138
- add_action( 'advanced-sidebar-menu/widget/category/right-column', 'advanced_sidebar_menu_upgrade_notice', 1, 2 );
139
- add_action( 'advanced-sidebar-menu/widget/page/right-column', 'advanced_sidebar_menu_upgrade_notice', 1, 2 );
140
-
141
-
142
- /**
143
- * Notify widget users about the PRO options
144
- *
145
- * @param array $instance - widget instance.
146
- * @param WP_Widget $widget - widget class.
147
- *
148
- * @return void
149
- */
150
- function advanced_sidebar_menu_upgrade_notice( array $instance, WP_Widget $widget ) {
151
- if ( defined( 'ADVANCED_SIDEBAR_MENU_PRO_VERSION' ) ) {
152
- return;
153
- }
154
- ?>
155
- <div class="advanced-sidebar-menu-column-box">
156
- <h3><?php esc_html_e( 'Checkout Advanced Sidebar Menu Pro!', 'advanced-sidebar-menu' ); ?></h3>
157
- <p>
158
- <strong>
159
- <?php
160
- /* translators: {<a>}{</a>} links to https://matlipe.com/product/advanced-sidebar-menu-pro/ */
161
- printf( esc_html_x( 'Upgrade to %1$sAdvanced Sidebar Menu Pro%2$s for these features and so much more!', '{<a>}{</a>}', 'advanced-sidebar-menu' ), '<a target="blank" href="https://matlipe.com/product/advanced-sidebar-menu-pro/">', '</a>' );
162
- ?>
163
- </strong>
164
- <ol style="list-style: disc">
165
- <li><?php esc_html_e( 'Priority support, including access to Members Only Support Area.', 'advanced-sidebar-menu' ); ?></li>
166
- <li><?php esc_html_e( 'Accordion menu support.', 'advanced-sidebar-menu' ); ?></li>
167
- <li><?php esc_html_e( 'Click and drag menu styling including bullets, colors, sizes, block styles, borders, and border colors.', 'advanced-sidebar-menu' ); ?></li>
168
- <?php
169
- // page widget options.
170
- if ( 'advanced_sidebar_menu' === $widget->id_base ) {
171
- ?>
172
- <li><?php esc_html_e( "Ability to customize each page's link text.", 'advanced-sidebar-menu' ); ?></li>
173
- <li><?php esc_html_e( 'Ability to exclude a page from all menus using a simple checkbox.', 'advanced-sidebar-menu' ); ?></li>
174
- <li><?php esc_html_e( 'Number of levels of pages to show when always displayed child pages is not checked.', 'advanced-sidebar-menu' ); ?></li>
175
- <li><?php esc_html_e( 'Ability to select and display custom post types.', 'advanced-sidebar-menu' ); ?></li>
176
- <li><?php esc_html_e( 'Option to display the current page’s parents, grandparents, and children only, as well as siblings options.', 'advanced-sidebar-menu' ); ?></li>
177
- <?php
178
- // category widget options.
179
- } else {
180
- ?>
181
- <li><?php esc_html_e( 'Link ordering for the category widget.', 'advanced-sidebar-menu' ); ?></li>
182
- <li><?php esc_html_e( 'Ability to select and display custom taxonomies.', 'advanced-sidebar-menu' ); ?></li>
183
- <li><?php esc_html_e( 'Ability to display assigned posts or custom post types under categories.', 'advanced-sidebar-menu' ); ?></li>
184
- <?php
185
- }
186
- ?>
187
- <li><?php esc_html_e( 'Ability to display the widgets everywhere the sidebar displays.', 'advanced-sidebar-menu' ); ?></li>
188
- <li><?php esc_html_e( 'Support for custom navigation menus from Appearance -> Menus.', 'advanced-sidebar-menu' ); ?></li>
189
- </ol>
190
- <p>
191
- </div>
192
- <?php
193
- }
7.6.1/composer.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "name": "lipemat/advanced-sidebar-menu",
3
- "description": "Menu widget generator for wordpress",
4
- "type": "wordpress-plugin",
5
- "license": "MIT",
6
- "authors": [
7
- {
8
- "name": "lipemat",
9
- "email": "mat@matlipe.com"
10
- }
11
- ],
12
- "minimum-stability": "dev",
13
- "require": {}
14
- }
7.6.1/languages/advanced-sidebar-menu-de_DE.mo DELETED
Binary file
7.6.1/languages/advanced-sidebar-menu-de_DE.po DELETED
@@ -1,230 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Advanced Sidebar Menu\n"
4
- "POT-Creation-Date: 2019-03-05 12:29-0500\n"
5
- "PO-Revision-Date: 2019-03-05 12:30-0500\n"
6
- "Last-Translator: Mat Lipe <mat@matlipe.com>\n"
7
- "Language-Team: \n"
8
- "Language: de\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Generator: Poedit 2.2.1\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
- "X-Poedit-WPHeader: advanced-sidebar-menu.php\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
- "X-Poedit-SearchPathExcluded-0: *.js\n"
23
-
24
- #: advanced-sidebar-menu.php:156
25
- msgid "Checkout Advanced Sidebar Menu Pro!"
26
- msgstr "Kasse Advanced Sidebar Menu Pro!"
27
-
28
- #. translators: {<a>}{</a>} links to https://matlipe.com/product/advanced-sidebar-menu-pro/
29
- #: advanced-sidebar-menu.php:161
30
- #, php-format
31
- msgctxt "{<a>}{</a>}"
32
- msgid ""
33
- "Upgrade to %1$sAdvanced Sidebar Menu Pro%2$s for these features and so much "
34
- "more!"
35
- msgstr ""
36
- "Upgrade auf %1$sAdvanced Sidebar Menu Pro%2$s für diese Funktionen und "
37
- "vieles mehr!"
38
-
39
- #: advanced-sidebar-menu.php:165
40
- msgid "Priority support, including access to Members Only Support Area."
41
- msgstr ""
42
- "Prioritätsunterstützung, einschließlich Zugang zum Supportbereich für "
43
- "Mitglieder."
44
-
45
- #: advanced-sidebar-menu.php:166
46
- msgid "Accordion menu support."
47
- msgstr "Akkordeon-Menü-Unterstützung."
48
-
49
- #: advanced-sidebar-menu.php:167
50
- msgid ""
51
- "Click and drag menu styling including bullets, colors, sizes, block styles, "
52
- "borders, and border colors."
53
- msgstr ""
54
- "Klicken und ziehen Sie das Menü-Styling, einschließlich Aufzählungszeichen, "
55
- "Farben, Größen, Blockstile, Rahmen und Rahmenfarben."
56
-
57
- #: advanced-sidebar-menu.php:172
58
- msgid "Ability to customize each page's link text."
59
- msgstr "Möglichkeit, den Linktext jeder Seite anzupassen."
60
-
61
- #: advanced-sidebar-menu.php:173
62
- msgid "Ability to exclude a page from all menus using a simple checkbox."
63
- msgstr ""
64
- "Möglichkeit, eine Seite mit einem einfachen Kontrollkästchen aus allen Menüs "
65
- "auszuschließen."
66
-
67
- #: advanced-sidebar-menu.php:174
68
- msgid ""
69
- "Number of levels of pages to show when always displayed child pages is not "
70
- "checked."
71
- msgstr ""
72
- "Anzahl der Seitenebenen, die angezeigt werden sollen, wenn immer "
73
- "untergeordnete Seiten angezeigt werden, ist nicht aktiviert."
74
-
75
- #: advanced-sidebar-menu.php:175
76
- msgid "Ability to select and display custom post types."
77
- msgstr ""
78
- "Möglichkeit, benutzerdefinierte Beitragstypen auszuwählen und anzuzeigen."
79
-
80
- #: advanced-sidebar-menu.php:176
81
- msgid ""
82
- "Option to display the current page’s parents, grandparents, and children "
83
- "only, as well as siblings options."
84
- msgstr ""
85
- "Option, um die Eltern, Großeltern und Kinder der aktuellen Seite anzuzeigen, "
86
- "sowie Geschwisteroptionen."
87
-
88
- #: advanced-sidebar-menu.php:181
89
- msgid "Link ordering for the category widget."
90
- msgstr "Verknüpfungsreihenfolge für das Kategorie-Widget."
91
-
92
- #: advanced-sidebar-menu.php:182
93
- msgid "Ability to select and display custom taxonomies."
94
- msgstr "Möglichkeit, benutzerdefinierte Taxonomien auszuwählen und anzuzeigen."
95
-
96
- #: advanced-sidebar-menu.php:183
97
- msgid ""
98
- "Ability to display assigned posts or custom post types under categories."
99
- msgstr ""
100
- "Fähigkeit, zugewiesene Beiträge oder benutzerdefinierte Posttypen unter "
101
- "Kategorien anzuzeigen."
102
-
103
- #: advanced-sidebar-menu.php:187
104
- msgid "Ability to display the widgets everywhere the sidebar displays."
105
- msgstr "Die Fähigkeit, die Widgets überall in der Sidebar-Anzeige anzuzeigen."
106
-
107
- #: advanced-sidebar-menu.php:188
108
- msgid "Support for custom navigation menus from Appearance -> Menus."
109
- msgstr ""
110
- "Unterstützung für kundenspezifische Navigationsmenüs von Appearance-> Menü."
111
-
112
- #: src/Widget/Category.php:44
113
- msgid ""
114
- "Creates a menu of all the categories using the child/parent relationship"
115
- msgstr ""
116
- "Erstellt ein Menü aller Kategorien, die unter Zugrundelegung der Eltern-Kind-"
117
- "Beziehung"
118
-
119
- #: src/Widget/Category.php:48
120
- msgid "Advanced Sidebar Categories Menu"
121
- msgstr "Advanced Sidebar Kategorien-Menü"
122
-
123
- #: src/Widget/Category.php:83
124
- msgid "Display highest level parent category"
125
- msgstr "Anzeige der übergeordneten Kategorie der höchsten Ebene"
126
-
127
- #: src/Widget/Category.php:89
128
- msgid "Display menu when there is only the parent category"
129
- msgstr "Menü \"Anzeige\" wird nur die übergeordnete Kategorie"
130
-
131
- #: src/Widget/Category.php:95
132
- msgid "Always display child categories"
133
- msgstr "Immer untergeordnete Kategorien anzeigen"
134
-
135
- #: src/Widget/Category.php:101
136
- msgid "Levels of child categories to display"
137
- msgstr "Niveau der Kinderkategorien zu zeigen"
138
-
139
- #: src/Widget/Category.php:138 src/Widget/Page.php:150
140
- msgid "Use this plugin's default styling"
141
- msgstr "Verwenden Sie das Standardstyling dieses Plugins"
142
-
143
- #: src/Widget/Category.php:161
144
- msgid "Display categories on single posts"
145
- msgstr "Kategorien auf einzelne Beiträge anzeigen"
146
-
147
- #: src/Widget/Category.php:167
148
- msgid "Display each single post's category"
149
- msgstr "Zeigen Sie die einzelnen Kategorien der einzelnen Posts an"
150
-
151
- #: src/Widget/Category.php:173
152
- msgid "In a new widget"
153
- msgstr "In einem neuen Widget"
154
-
155
- #: src/Widget/Category.php:176
156
- msgid "In another list in the same widget"
157
- msgstr "In einer anderen Liste im selben Widget"
158
-
159
- #: src/Widget/Category.php:200
160
- msgid "Categories to exclude (ids), comma separated"
161
- msgstr "Kategorien ausschließen (Ids), durch Kommata getrennt"
162
-
163
- #: src/Widget/Category.php:233 src/Widget/Page.php:242
164
- msgid "Title"
165
- msgstr "Titel"
166
-
167
- #: src/Widget/Page.php:39
168
- msgid "Creates a menu of all the pages using the child/parent relationship"
169
- msgstr ""
170
- "Erstellt ein Menü mit allen Seiten, die die Child / Parent-Beziehung "
171
- "verwenden"
172
-
173
- #: src/Widget/Page.php:45
174
- msgid "Advanced Sidebar Pages Menu"
175
- msgstr "Advanced Sidebar Seitenmenü"
176
-
177
- #: src/Widget/Page.php:82
178
- msgid "Display highest level parent page"
179
- msgstr "Zeigt die oberste Seite der obersten Ebene an"
180
-
181
- #: src/Widget/Page.php:90
182
- msgid "Display menu when there is only the parent page"
183
- msgstr "Menü \"Anzeige\" wird nur die übergeordnete Seite"
184
-
185
- #: src/Widget/Page.php:97
186
- msgid "Always display child pages"
187
- msgstr "Immer untergeordnete Seiten anzeigen"
188
-
189
- #: src/Widget/Page.php:110
190
- msgid "Maximum level of child pages to display"
191
- msgstr "Maximale Höhe der zu zeigestellenden Kinderseiten"
192
-
193
- #: src/Widget/Page.php:114
194
- msgid " - All - "
195
- msgstr " Alle "
196
-
197
- #: src/Widget/Page.php:171
198
- msgid "Order by"
199
- msgstr "Sortieren nach"
200
-
201
- #: src/Widget/Page.php:210
202
- msgid "Pages to exclude (ids), comma separated"
203
- msgstr "Auszuschließende Seiten (IDs), durch Kommas getrennt"
204
-
205
- #. Plugin Name of the plugin/theme
206
- msgid "Advanced Sidebar Menu"
207
- msgstr "Advanced Sidebar Menu"
208
-
209
- #. Plugin URI of the plugin/theme
210
- msgid "https://matlipe.com/advanced-sidebar-menu/"
211
- msgstr "https://matlipe.com/advanced-sidebar-menu/"
212
-
213
- #. Description of the plugin/theme
214
- msgid ""
215
- "Creates dynamic menus based on parent/child relationship of your pages or "
216
- "categories."
217
- msgstr ""
218
- "Dynamische Menüs basierend auf Parent/Child-Beziehung Ihrer Seiten oder "
219
- "Kategorien erstellt."
220
-
221
- #. Author of the plugin/theme
222
- msgid "Mat Lipe"
223
- msgstr "Mat Lipe"
224
-
225
- #. Author URI of the plugin/theme
226
- msgid "https://matlipe.com"
227
- msgstr "https://matlipe.com"
228
-
229
- #~ msgid "Use this Plugin's Styling"
230
- #~ msgstr "Benutze das Plugin Styling"
7.6.1/languages/advanced-sidebar-menu.pot DELETED
@@ -1,205 +0,0 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
- "Project-Id-Version: Advanced Sidebar Menu\n"
6
- "POT-Creation-Date: 2019-03-05 12:29-0500\n"
7
- "PO-Revision-Date: 2019-03-05 12:29-0500\n"
8
- "Last-Translator: \n"
9
- "Language-Team: \n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 2.2.1\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
- "X-Poedit-WPHeader: advanced-sidebar-menu.php\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
- "X-Poedit-SearchPathExcluded-0: *.js\n"
23
-
24
- #: advanced-sidebar-menu.php:156
25
- msgid "Checkout Advanced Sidebar Menu Pro!"
26
- msgstr ""
27
-
28
- #. translators: {<a>}{</a>} links to https://matlipe.com/product/advanced-sidebar-menu-pro/
29
- #: advanced-sidebar-menu.php:161
30
- #, php-format
31
- msgctxt "{<a>}{</a>}"
32
- msgid ""
33
- "Upgrade to %1$sAdvanced Sidebar Menu Pro%2$s for these features and so much "
34
- "more!"
35
- msgstr ""
36
-
37
- #: advanced-sidebar-menu.php:165
38
- msgid "Priority support, including access to Members Only Support Area."
39
- msgstr ""
40
-
41
- #: advanced-sidebar-menu.php:166
42
- msgid "Accordion menu support."
43
- msgstr ""
44
-
45
- #: advanced-sidebar-menu.php:167
46
- msgid ""
47
- "Click and drag menu styling including bullets, colors, sizes, block styles, "
48
- "borders, and border colors."
49
- msgstr ""
50
-
51
- #: advanced-sidebar-menu.php:172
52
- msgid "Ability to customize each page's link text."
53
- msgstr ""
54
-
55
- #: advanced-sidebar-menu.php:173
56
- msgid "Ability to exclude a page from all menus using a simple checkbox."
57
- msgstr ""
58
-
59
- #: advanced-sidebar-menu.php:174
60
- msgid ""
61
- "Number of levels of pages to show when always displayed child pages is not "
62
- "checked."
63
- msgstr ""
64
-
65
- #: advanced-sidebar-menu.php:175
66
- msgid "Ability to select and display custom post types."
67
- msgstr ""
68
-
69
- #: advanced-sidebar-menu.php:176
70
- msgid ""
71
- "Option to display the current page’s parents, grandparents, and children "
72
- "only, as well as siblings options."
73
- msgstr ""
74
-
75
- #: advanced-sidebar-menu.php:181
76
- msgid "Link ordering for the category widget."
77
- msgstr ""
78
-
79
- #: advanced-sidebar-menu.php:182
80
- msgid "Ability to select and display custom taxonomies."
81
- msgstr ""
82
-
83
- #: advanced-sidebar-menu.php:183
84
- msgid ""
85
- "Ability to display assigned posts or custom post types under categories."
86
- msgstr ""
87
-
88
- #: advanced-sidebar-menu.php:187
89
- msgid "Ability to display the widgets everywhere the sidebar displays."
90
- msgstr ""
91
-
92
- #: advanced-sidebar-menu.php:188
93
- msgid "Support for custom navigation menus from Appearance -> Menus."
94
- msgstr ""
95
-
96
- #: src/Widget/Category.php:44
97
- msgid ""
98
- "Creates a menu of all the categories using the child/parent relationship"
99
- msgstr ""
100
-
101
- #: src/Widget/Category.php:48
102
- msgid "Advanced Sidebar Categories Menu"
103
- msgstr ""
104
-
105
- #: src/Widget/Category.php:83
106
- msgid "Display highest level parent category"
107
- msgstr ""
108
-
109
- #: src/Widget/Category.php:89
110
- msgid "Display menu when there is only the parent category"
111
- msgstr ""
112
-
113
- #: src/Widget/Category.php:95
114
- msgid "Always display child categories"
115
- msgstr ""
116
-
117
- #: src/Widget/Category.php:101
118
- msgid "Levels of child categories to display"
119
- msgstr ""
120
-
121
- #: src/Widget/Category.php:138 src/Widget/Page.php:150
122
- msgid "Use this plugin's default styling"
123
- msgstr ""
124
-
125
- #: src/Widget/Category.php:161
126
- msgid "Display categories on single posts"
127
- msgstr ""
128
-
129
- #: src/Widget/Category.php:167
130
- msgid "Display each single post's category"
131
- msgstr ""
132
-
133
- #: src/Widget/Category.php:173
134
- msgid "In a new widget"
135
- msgstr ""
136
-
137
- #: src/Widget/Category.php:176
138
- msgid "In another list in the same widget"
139
- msgstr ""
140
-
141
- #: src/Widget/Category.php:200
142
- msgid "Categories to exclude (ids), comma separated"
143
- msgstr ""
144
-
145
- #: src/Widget/Category.php:233 src/Widget/Page.php:242
146
- msgid "Title"
147
- msgstr ""
148
-
149
- #: src/Widget/Page.php:39
150
- msgid "Creates a menu of all the pages using the child/parent relationship"
151
- msgstr ""
152
-
153
- #: src/Widget/Page.php:45
154
- msgid "Advanced Sidebar Pages Menu"
155
- msgstr ""
156
-
157
- #: src/Widget/Page.php:82
158
- msgid "Display highest level parent page"
159
- msgstr ""
160
-
161
- #: src/Widget/Page.php:90
162
- msgid "Display menu when there is only the parent page"
163
- msgstr ""
164
-
165
- #: src/Widget/Page.php:97
166
- msgid "Always display child pages"
167
- msgstr ""
168
-
169
- #: src/Widget/Page.php:110
170
- msgid "Maximum level of child pages to display"
171
- msgstr ""
172
-
173
- #: src/Widget/Page.php:114
174
- msgid " - All - "
175
- msgstr ""
176
-
177
- #: src/Widget/Page.php:171
178
- msgid "Order by"
179
- msgstr ""
180
-
181
- #: src/Widget/Page.php:210
182
- msgid "Pages to exclude (ids), comma separated"
183
- msgstr ""
184
-
185
- #. Plugin Name of the plugin/theme
186
- msgid "Advanced Sidebar Menu"
187
- msgstr ""
188
-
189
- #. Plugin URI of the plugin/theme
190
- msgid "https://matlipe.com/advanced-sidebar-menu/"
191
- msgstr ""
192
-
193
- #. Description of the plugin/theme
194
- msgid ""
195
- "Creates dynamic menus based on parent/child relationship of your pages or "
196
- "categories."
197
- msgstr ""
198
-
199
- #. Author of the plugin/theme
200
- msgid "Mat Lipe"
201
- msgstr ""
202
-
203
- #. Author URI of the plugin/theme
204
- msgid "https://matlipe.com"
205
- msgstr ""
7.6.1/readme.txt DELETED
@@ -1,267 +0,0 @@
1
- === Advanced Sidebar Menu ===
2
-
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.8.0
7
- Tested up to: 5.2.3
8
- Requires PHP: 5.6.0
9
- Stable tag: 7.6.2
10
-
11
- == Description ==
12
-
13
- Uses the parent/child relationship of your pages or categories to generate menus based on the current section of your site. Assign a page or category to a parent and this will do the rest for you.
14
-
15
- Keeps the menu clean and usable. Only related items display so you don't have to worry about keeping a custom menu up to date or displaying links to items that don't belong.
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.9.0</a> is now available with support to exclude and change titles of navigation menu items using each page's settings!</blockquote>
20
-
21
- <h4>Features</h4>
22
- * Page and Category widgets.
23
- * Option to display or not display the highest level parent page or category.
24
- * Option to display the menu when there is only the highest level parent.
25
- * Ability to order pages by (date, title, page order).
26
- * Exclude pages or categories by entering a comma separated list of ids.
27
- * Option to always display child pages or categories.
28
- * Option to select the levels of pages or categories to display when always display child is used.
29
- * Option to display or not display categories on single posts.
30
- * Ability to display each single post's category in a new widget or in same list.
31
-
32
- <h4>Page Widget Options</h4>
33
- * Add a title to the widget
34
- * Display highest level parent page
35
- * Display menu when there is only the parent page
36
- * Order pages by (date, title, page order)
37
- * Use built in styling (very plain styling, for more advanced styling <a href="https://matlipe.com/product/advanced-sidebar-menu-pro/" target="_blank">Go Pro!</a>)
38
- * Exclude pages
39
- * Always display child Pages
40
- * Number of levels of child pages to display when always display child pages is checked
41
-
42
- <h4>Category Widget Options</h4>
43
- * Add a title to the widget
44
- * Display highest level parent category
45
- * Display menu when there is only the parent category
46
- * Use built in styling (very plain styling, for more advanced styling <a href="https://matlipe.com/product/advanced-sidebar-menu-pro/" target="_blank">Go Pro!</a>)
47
- * Display categories on single posts
48
- * Display each single post's category in a new widget or in same list
49
- * Exclude categories
50
- * Always display child categories
51
- * Levels of Categories to display when always display child categories is checked
52
-
53
- <h4>Pro Features</h4>
54
- * Priority support.
55
- * Ability to customize each page's link text.
56
- * Click and drag styling for page, category, and navigation menu widgets.
57
- * Styling options for links including color, background color, size, and font weight.
58
- * Styling options for different levels of links.
59
- * Styling options for the current page or category.
60
- * Styling options for the parent of the current page or category.
61
- * Block styling options including borders and border colors.
62
- * Bullet style selection from 7 styles or select none to have no bullets.
63
- * Accordion menu support for pages, categories, and navigation menus.
64
- * Accordion icon style and color selection.
65
- * Accordion option to keep all sections closed until clicked.
66
- * Accordion option to include highest level parent in accordion.
67
- * Ability to exclude a page from all menus using a simple checkbox.
68
- * Link ordering for the category widget.
69
- * Number of levels of pages to show when always displayed child pages is not checked.
70
- * Ability to select and display custom post types.
71
- * Ability to select and display custom taxonomies.
72
- * Optionally display the current page's parents, grandparents, and children only.
73
- * Optionally display child page siblings when on a child page. With our without grandchildren available. .
74
- * Ability to display the widgets everywhere the sidebar displays.
75
- * Ability to select the parent page/category when using the display widget everywhere option.
76
- * Ability to display assigned posts or custom post types under categories. **NEW**
77
- * Ability to select which levels of categories assigned posts should display under. **NEW**
78
- * Ability to limit the number of posts or custom post types to display under categories.
79
- * Support for custom navigation menus from Appearance -> Menus.
80
- * Ability to display the current Navigation Menu's items parents and children only.
81
- * Optionally display the top level Navigation Menu's items when there are no child items or not viewing a menu item. **NEW**
82
- * Access to members only support area.
83
-
84
- <h4>Currently ships with the following languages</h4>
85
- * English (US)
86
- * German (de_DE)
87
-
88
- <h4>Developers</h4>
89
- Developer docs may be found <a target="_blank" href="https://matlipe.com/advanced-sidebar-menu/developer-docs/">here</a>.
90
-
91
- <h4>Contribute</h4>
92
- Send pull requests via the <a target="_blank" href="https://github.com/lipemat/advanced-sidebar-menu">GitHub Repo</a>
93
-
94
-
95
- == Installation ==
96
-
97
- Use the standard WordPress plugins search and install feature.
98
-
99
- Manual Installation
100
-
101
- 1. Upload the `advanced-sidebar-menu` folder to the `/wp-content/plugins/` directory
102
- 1. Activate the plugin through the 'Plugins' menu in WordPress
103
- 1. Drag the "Advanced Sidebar Pages Menu" widget or the "Advanced Sidebar Categories Menu" widget into a sidebar.
104
-
105
-
106
- == Screenshots ==
107
-
108
- 1. Page widget options
109
- 2. Category widget options
110
- 3. Example of a page menu using the 2017 theme and default styles
111
- 3. Example of a category menu ordered by title using the 2017 theme and default styles
112
-
113
-
114
- == Frequently Asked Questions ==
115
-
116
- Developer docs may be found here:
117
- <a href="https://matlipe.com/advanced-sidebar-menu/developer-docs/" target="_blank">https://matlipe.com/advanced-sidebar-menu/developer-docs/</a>
118
-
119
-
120
- = How do I change the styling of the current page? =
121
-
122
- You may add css to your theme's style.css to change the way the menu looks
123
-
124
- For Instance This would remove the dot and change the color
125
- <code>
126
- .advanced-sidebar-menu li.current_page_item a {
127
- color: black;
128
- }
129
-
130
- .advanced-sidebar-menu li.current_page_item {
131
- list-style-type: none !important;
132
- }
133
- </code>
134
-
135
- To style your menu without using any code <a href="https://matlipe.com/product/advanced-sidebar-menu-pro/" target="_blank">Go Pro!</a>
136
-
137
- = How do you get the categories to display on single post pages? =
138
-
139
- There is a checkbox in the widget options that will display the same structure for the categories the post is in.
140
-
141
- = How do you edit the output or built in css? =
142
-
143
- Create a folder in your child theme named "advanced-sidebar-menu" copy any of the files from the "views" folder into
144
- the folder you just created. You may edit the files to change the output or css. You must have the option checked to use the built in CSS (in the widget) to be able to edit the css file in this way.
145
-
146
-
147
- = Does the menu change for each page you are on? =
148
-
149
- Yes. Based on whatever page, post, or category you are on, the menu will change automatically to display the current parents and children.
150
-
151
-
152
- == Changelog ==
153
- = 7.6.0 =
154
- * Elementor support for multiple widgets of the same type on the same page.
155
- * Automatically increment widget ids under any cases where they would duplicate.
156
- * Bump required WordPress Core version to 4.8.0.
157
-
158
- = 7.5.0 =
159
- * Convert "Always display child pages" to use our List_Pages structure and support all widget options.
160
- * Bump required PHP version to 5.4.4.
161
-
162
- = 7.4.0 =
163
- * Added support for Beaver Builder
164
-
165
- = 7.3.0 =
166
- * Greatly improve category widget performance
167
-
168
- = 7.2.0 =
169
- * New improved widget structure
170
-
171
- = 7.1.0 =
172
- * Support Pro Version 3.0.0
173
- * Add German translations
174
- * Begin converting code formatting to strict WordPress standards
175
-
176
- = 7.0.0 =
177
- * Restructure the codebase to a more modern PSR4 structure
178
- * Improve cache handling
179
- * Improve verbiage in admin
180
- * Implement new actions and filters
181
- * Rebuild templates for improved stability and future changes
182
- * Improve performance
183
- * Kill conflicting backward compatibility with version 5
184
- * Open up more extendability possibilities
185
-
186
- = 6.4.0 =
187
- * Code improvements
188
- * Performance improvements via shared child retrieval
189
-
190
- = 6.3.0
191
- * Improve category class handling for pro version accordion support
192
-
193
- = 6.2.0 =
194
- * Improve sorting of categories
195
-
196
- = 6.1.0 =
197
- * Improve page list view
198
- * Add advanced_sidebar_menu_list_pages_args filter
199
-
200
- = 6.0.0 =
201
- * Remove legacy template support
202
- * Restructure plugin
203
- * Introduce 'advanced_sidebar_menu_template_part' filter
204
-
205
-
206
- = 5.1.0 =
207
- * Convert query over to get_posts() to allow for more extendability
208
- * Implement object caching to improve performance for environments using external object caches
209
- * Begin modernizing the naming conventions of methods and improving PHPdocs
210
-
211
- = 5.0.0 =
212
- * Greatly improved performance
213
- * Improved code structure
214
-
215
- = 4.7.0 =
216
- * Added Internationalization (I18n) support
217
-
218
- = 4.6.0 =
219
- * Added support for Pro Version
220
-
221
- = 4.5.0 =
222
- * Improved filter structure to allow for add-ons to work more effectively
223
-
224
-
225
- = 4.4.0 =
226
- * Added a has_children class to page links with hidden children
227
-
228
- = 4.3.0 =
229
- * Added many filters into the category widget for things like taxonomies, parent category, display on override, order by, and much more. There is no UI support for any of this yet, but developers may now tap into this.
230
-
231
- = 4.2.0 =
232
- * Added Order By Selection in Page Widget
233
-
234
- = 4.0.0 =
235
- * Added support for an unlimited number of page levels
236
- * Change structure slightly for future enhancements
237
- * Added Legacy Mode for backwards compatibility
238
-
239
-
240
- == Upgrade Notice ==
241
- = 7.5.0 =
242
- Update to support PRO version 3.6.0
243
-
244
- = 7.4.7 =
245
- Update to support PRO version 3.5.0
246
-
247
- = 7.4.2 =
248
- Update to support PRO version 3.4.3
249
-
250
- = 7.4.0 =
251
- Update to support PRO version 3.4.0
252
-
253
- = 7.2.2 =
254
- Update to support PRO version 3.2.0
255
-
256
- = 7.1.2 =
257
- Update to support PRO version 3.1.0
258
-
259
- = 7.0.0 =
260
- The templates have been improved drastically. While the old version 6 templates will work for now they have been deprecated and will one day stop working. If you are using custom templates please being converting them to the new structure.
261
-
262
- = 6.0.0 =
263
- If you are using the Pro version of this plugin be sure to update to Pro version 1.4.4 to keep all functionality intact with this version.
264
-
265
- = 5.0.0 =
266
- If you used a custom page_list.php template previously you may want to redo it on this version to take advantage of the new structure.
267
-
7.6.1/resources/css/advanced-sidebar-menu.css DELETED
@@ -1,26 +0,0 @@
1
- .advanced-sidebar-menu-column {
2
- float: left;
3
- width: 49%;
4
- }
5
-
6
- .advanced-sidebar-menu-column-right {
7
- margin-left: 2%;
8
- }
9
-
10
- .advanced-sidebar-menu-column-box {
11
- margin-bottom: 10px;
12
- padding: 10px;
13
- border: 1px solid #ddd;
14
- background: #f1f1f1;
15
- }
16
-
17
- .advanced-sidebar-menu-full-width {
18
- width: 100%;
19
- clear: both;
20
- }
21
-
22
- @media all and ( max-width: 620px ) {
23
- .advanced-sidebar-menu-column {
24
- width: 100%;
25
- }
26
- }
7.6.1/resources/js/advanced-sidebar-menu.js DELETED
@@ -1,72 +0,0 @@
1
- /**
2
- * Change the style display to block
3
- * For the element that is sent to it
4
- * Use the id or inline tags for this
5
- *
6
- **/
7
- function asm_reveal_element(this_element_id) {
8
- var el = jQuery('[data-js="' + this_element_id + '"]');
9
-
10
- el.toggle();
11
- var status = el.is(':visible') ? 'show' : 'hide';
12
- advanced_sidebar_menu.set_hide_state(el);
13
- jQuery(document).trigger('advanced-sidebar-menu/reveal-element', [this_element_id, status]);
14
- }
15
-
16
- /**
17
- * Proper handling of the show/hide of elements
18
- * for widgets
19
- *
20
- * @since 7.4.5
21
- */
22
- var advanced_sidebar_menu = {
23
-
24
- /**
25
- * Called by PHP so this will run no matter where the widget is loaded.
26
- * This solves issues with page builders as well as widget updating.
27
- *
28
- * @since 7.4.5
29
- */
30
- init: function () {
31
- this.show_hide_elements();
32
- jQuery(document).trigger('advanced-sidebar-menu/init');
33
- },
34
-
35
- /**
36
- * Set the data attribute to the current show/hide state so we
37
- * can track it's visibility and not improperly show/hide an element
38
- * when a widget is saved.
39
- *
40
- * Solves the issue where updating one widget could affect another.
41
- *
42
- * @since 7.4.5
43
- *
44
- * @param el
45
- */
46
- set_hide_state: function (el) {
47
- if (el.is(':visible')) {
48
- el.data('advanced-sidebar-menu-hide', 0);
49
- } else {
50
- el.data('advanced-sidebar-menu-hide', 1);
51
- }
52
- },
53
-
54
- /**
55
- * Use JS to show/hide widget elements instead of PHP because sometimes widgets are loaded
56
- * in weird ways like ajax and we don't want any fields hidden if the JS is never loaded
57
- * to later show them
58
- *
59
- * @since 7.4.5
60
- *
61
- */
62
- show_hide_elements: function () {
63
- jQuery('[data-advanced-sidebar-menu-hide]').each(function () {
64
- var el = jQuery(this);
65
- if (el.data('advanced-sidebar-menu-hide')) {
66
- el.hide();
67
- } else {
68
- el.show();
69
- }
70
- });
71
- }
72
- };
7.6.1/src/Cache.php DELETED
@@ -1,137 +0,0 @@
1
- <?php
2
-
3
-
4
- /**
5
- * Advanced_Sidebar_Menu_Cache
6
- *
7
- * @author Mat Lipe
8
- * @since 12/19/2015
9
- *
10
- */
11
- class Advanced_Sidebar_Menu_Cache {
12
- const CACHE_GROUP = 'advanced-sidebar-menu';
13
- const CHILD_PAGES_KEY = 'child-pages';
14
-
15
-
16
- protected function hook() {
17
- add_action( 'save_post', array( $this, 'clear_cache_group' ) );
18
- }
19
-
20
-
21
- /**
22
- * Clear all of items in this cache group
23
- *
24
- * @return void
25
- */
26
- public function clear_cache_group() {
27
- if( function_exists( 'wp_cache_get_last_changed' ) ){
28
- wp_cache_set( 'last_changed', microtime(), self::CACHE_GROUP . ':' . ADVANCED_SIDEBAR_BASIC_VERSION );
29
- } else {
30
- wp_cache_delete( self::CHILD_PAGES_KEY, $this->get_cache_group() );
31
- }
32
- }
33
-
34
-
35
- /**
36
- * Get unique key for this group
37
- * Use wp_cache_get_last_changed() if on WP 4.7+
38
- *
39
- * @return string
40
- */
41
- public function get_cache_group() {
42
- $key = '';
43
- if( function_exists( 'wp_cache_get_last_changed' ) ){
44
- $key = wp_cache_get_last_changed( self::CACHE_GROUP . ':' . ADVANCED_SIDEBAR_BASIC_VERSION );
45
- }
46
-
47
- return self::CACHE_GROUP . ':' . ADVANCED_SIDEBAR_BASIC_VERSION . ':' . $key;
48
- }
49
-
50
-
51
- /**
52
- * Retrieve a posts child pages from the cache
53
- * If no exist in the cache will return false
54
- *
55
- * @param Advanced_Sidebar_Menu_Menu|Advanced_Sidebar_Menu_List_Pages $class
56
- *
57
- * @return array|false
58
- */
59
- public function get_child_pages( $class ) {
60
- $key = $this->get_key_from_asm( $class );
61
- $all_child_pages = (array) wp_cache_get( self::CHILD_PAGES_KEY, $this->get_cache_group() );
62
- if( isset( $all_child_pages[ $key ] ) ){
63
- return $all_child_pages[ $key ];
64
- }
65
- return false;
66
- }
67
-
68
-
69
- /**
70
- * Add a post and its children to the cache
71
- * Uses a global key for all posts so this appends to an array
72
- *
73
- * @param Advanced_Sidebar_Menu_Menu|Advanced_Sidebar_Menu_List_Pages $class
74
- * @param array $child_pages
75
- *
76
- * @return void
77
- */
78
- public function add_child_pages( $class, $child_pages ) {
79
- $key = $this->get_key_from_asm( $class );
80
- $all_child_pages = (array) wp_cache_get( self::CHILD_PAGES_KEY, $this->get_cache_group() );
81
- $all_child_pages[ $key ] = $child_pages;
82
- wp_cache_set( self::CHILD_PAGES_KEY, $all_child_pages, $this->get_cache_group() );
83
- }
84
-
85
-
86
- /**
87
- * There are many possibilities for properties
88
- * set to the object used for generations.
89
- * To guarantee we have a unique id for the cache
90
- * we serialize the whole object and hash it
91
- *
92
- *
93
- * @param Advanced_Sidebar_Menu_Menu|Advanced_Sidebar_Menu_List_Pages $class
94
- *
95
- * @return string
96
- */
97
- private function get_key_from_asm( $class ) {
98
- $string = serialize( $class );
99
- return md5( $string );
100
- }
101
-
102
-
103
- //********** SINGLETON FUNCTIONS **********/
104
-
105
-
106
- /**
107
- * Instance of this class for use as singleton
108
- */
109
- private static $instance;
110
-
111
-
112
- /**
113
- * Create the instance of the class
114
- *
115
- * @static
116
- * @return void
117
- */
118
- public static function init() {
119
- self::instance()->hook();
120
- }
121
-
122
-
123
- /**
124
- * Get (and instantiate, if necessary) the instance of the
125
- * class
126
- *
127
- * @static
128
- * @return self
129
- */
130
- public static function instance() {
131
- if( !is_a( self::$instance, __CLASS__ ) ){
132
- self::$instance = new self();
133
- }
134
-
135
- return self::$instance;
136
- }
137
- }
7.6.1/src/Core.php DELETED
@@ -1,94 +0,0 @@
1
- <?php
2
-
3
-
4
- /**
5
- * Advanced_Sidebar_Menu
6
- *
7
- * @author Mat Lipe
8
- * @since 7.0.0
9
- *
10
- */
11
- class Advanced_Sidebar_Menu_Core {
12
-
13
- protected function hook() {
14
- add_action( 'widgets_init', array( $this, 'register_widgets' ) );
15
- }
16
-
17
-
18
- public function register_widgets() {
19
- register_widget( 'Advanced_Sidebar_Menu_Widget_Page' );
20
- register_widget( 'Advanced_Sidebar_Menu_Widget_Category' );
21
- }
22
-
23
-
24
- /**
25
- * The plugin styles are universal
26
- * This ensures that we only include them once on a single request
27
- *
28
- * @return void
29
- */
30
- public function include_plugin_styles() {
31
- ?>
32
- <style>
33
- <?php include_once $this->get_template_part( 'sidebar-menu.css' ); ?>
34
- </style>
35
- <?php
36
- }
37
-
38
-
39
- /**
40
- * Retrieve a template file from either the theme's 'advanced-sidebar-menu' directory
41
- * or this plugins views folder if one does not exist
42
- *
43
- * @since 6.0.0
44
- *
45
- * @param string $file_name
46
- *
47
- * @return string
48
- */
49
- public function get_template_part( $file_name ) {
50
- $file = locate_template( 'advanced-sidebar-menu/' . $file_name );
51
- if ( empty( $file ) ) {
52
- $file = ADVANCED_SIDEBAR_DIR . 'views/' . $file_name;
53
- }
54
-
55
- $file = apply_filters( 'advanced_sidebar_menu_template_part', $file, $file_name, $this );
56
-
57
- return $file;
58
- }
59
-
60
- //********** SINGLETON FUNCTIONS **********/
61
-
62
-
63
- /**
64
- * Instance of this class for use as singleton
65
- */
66
- protected static $instance;
67
-
68
-
69
- /**
70
- * Create the instance of the class
71
- *
72
- * @static
73
- * @return void
74
- */
75
- public static function init() {
76
- self::instance()->hook();
77
- }
78
-
79
-
80
- /**
81
- * Get (and instantiate, if necessary) the instance of the
82
- * class
83
- *
84
- * @static
85
- * @return self
86
- */
87
- public static function instance() {
88
- if ( ! is_a( self::$instance, __CLASS__ ) ) {
89
- self::$instance = new self();
90
- }
91
-
92
- return self::$instance;
93
- }
94
- }
7.6.1/src/Debug.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Advanced_Sidebar_Menu_Debug
5
- *
6
- * @author Mat Lipe
7
- * @since 6.3.1
8
- * @since 7.4.8 - Use URL arguments to test different configurations.
9
- */
10
- class Advanced_Sidebar_Menu_Debug {
11
- const DEBUG_PARAM = 'asm_debug';
12
-
13
-
14
- /**
15
- * Add actions and filters.
16
- *
17
- * @return void
18
- */
19
- protected function hook() {
20
- if ( ! empty( $_GET[ self::DEBUG_PARAM ] ) ) { //phpcs:ignore
21
- add_action( 'advanced_sidebar_menu_widget_pre_render', array( $this, 'print_instance' ), 1, 2 );
22
-
23
- if ( is_array( $_GET[ self::DEBUG_PARAM ] ) ) { //phpcs:ignore
24
- add_filter( 'advanced-sidebar-menu/menus/widget-instance', array( $this, 'adjust_widget_settings' ) );
25
- }
26
- }
27
- }
28
-
29
-
30
- /**
31
- * Adjust widget settings using the URL.
32
- *
33
- * @param array $instance - Widget settings.
34
- *
35
- * @return array
36
- */
37
- public function adjust_widget_settings( array $instance ) {
38
- //phpcs:ignore
39
- $overrides = array_map( 'sanitize_text_field', (array) $_GET[ self::DEBUG_PARAM ] );
40
-
41
- return wp_parse_args( $overrides, $instance );
42
- }
43
-
44
-
45
- /**
46
- * Print the widget settings as a js variable.
47
- *
48
- * @param Advanced_Sidebar_Menu_Menus_Abstract $asm - Menu class.
49
- * @param Advanced_Sidebar_Menu_Widget_Page $widget - Widget class.
50
- *
51
- * @return void
52
- */
53
- public function print_instance( $asm, $widget ) {
54
- static $printed = false;
55
- $data = array(
56
- 'version' => ADVANCED_SIDEBAR_BASIC_VERSION,
57
- $widget->id => $asm->instance,
58
- );
59
- if ( defined( 'ADVANCED_SIDEBAR_MENU_PRO_VERSION' ) ) {
60
- $data['pro_version'] = ADVANCED_SIDEBAR_MENU_PRO_VERSION;
61
- }
62
-
63
- if ( ! $printed ) {
64
- ?>
65
- <script class="<?php echo esc_attr( self::DEBUG_PARAM ); ?>">
66
- var <?php echo esc_attr( self::DEBUG_PARAM ); ?> = <?php echo wp_json_encode( $data ); ?>;
67
- </script>
68
- <?php
69
- $printed = true;
70
- } else {
71
- ?>
72
- <script class="<?php echo esc_attr( self::DEBUG_PARAM ); ?>">
73
- <?php echo esc_attr( self::DEBUG_PARAM ); ?>['<?php echo esc_js( $widget->id ); ?>'] = <?php echo wp_json_encode( $asm->instance ); ?>;
74
- </script>
75
- <?php
76
- }
77
- }
78
-
79
-
80
- /**
81
- * Instance of this class for use as singleton
82
- *
83
- * @var Advanced_Sidebar_Menu_Debug
84
- */
85
- private static $instance;
86
-
87
-
88
- /**
89
- * Create the instance of the class
90
- *
91
- * @static
92
- * @return void
93
- */
94
- public static function init() {
95
- self::instance()->hook();
96
- }
97
-
98
-
99
- /**
100
- * Get (and instantiate, if necessary) the instance of the
101
- * class
102
- *
103
- * @static
104
- * @return self
105
- */
106
- public static function instance() {
107
- if ( ! is_a( self::$instance, __CLASS__ ) ) {
108
- self::$instance = new self();
109
- }
110
-
111
- return self::$instance;
112
- }
113
- }
7.6.1/src/List_Pages.php DELETED
@@ -1,360 +0,0 @@
1
- <?php
2
-
3
-
4
- /**
5
- * Advanced_Sidebar_Menu_List_Pages
6
- *
7
- * Parse and build the child and grandchild menus
8
- * Create the opening and closing <ul class="child-sidebar-menu">
9
- * in the view and this will fill in the guts.
10
- *
11
- * Send the args ( similar to wp_list_pages ) to the constructor and then
12
- * display by calling list_pages()
13
- *
14
- * @package Advanced Sidebar Menu
15
- *
16
- * @author Mat Lipe <mat@matlipe.com>
17
- *
18
- * @since 5.0.0
19
- */
20
- class Advanced_Sidebar_Menu_List_Pages {
21
-
22
- /**
23
- * The page list
24
- *
25
- * @var string
26
- */
27
- public $output = '';
28
-
29
- /**
30
- * Used when walking the list
31
- *
32
- * @var WP_Post
33
- */
34
- protected $current_page;
35
-
36
- /**
37
- * The top level parent id according to the menu class
38
- *
39
- * @var int
40
- */
41
- protected $top_parent_id;
42
-
43
- /**
44
- * Passed during construct given to walker and used for queries
45
- *
46
- * @var array
47
- */
48
- protected $args = array();
49
-
50
- /**
51
- * Used exclusively for caching
52
- * Holds the value of the latest parent we
53
- * retrieve children for so Cache can distinguish
54
- * between calls.
55
- *
56
- * @var int
57
- */
58
- protected $current_children_parent = 0;
59
-
60
- /**
61
- * Menu class
62
- *
63
- * @var \Advanced_Sidebar_Menu_Menus_Page
64
- */
65
- protected $menu;
66
-
67
-
68
- /**
69
- * Constructor
70
- *
71
- * @param \Advanced_Sidebar_Menu_Menus_Page $menu - The menu class.
72
- */
73
- protected function __construct( Advanced_Sidebar_Menu_Menus_Page $menu ) {
74
- $this->menu = $menu;
75
- $this->top_parent_id = $menu->get_top_parent_id();
76
- $this->current_page = $menu->get_current_post();
77
-
78
- $args = array(
79
- 'post_type' => $menu->get_post_type(),
80
- 'orderby' => $menu->get_order_by(),
81
- 'order' => $menu->get_order(),
82
- 'exclude' => $menu->get_excluded_ids(),
83
- 'levels' => $menu->get_levels_to_display(),
84
- );
85
-
86
- $this->args = $this->parse_args( $args );
87
- $this->hook();
88
- }
89
-
90
-
91
- /**
92
- * Hooks should only hook once
93
- *
94
- * @todo find a more appropriate place for this?
95
- *
96
- * @return void
97
- */
98
- protected function hook() {
99
- add_filter( 'page_css_class', array( $this, 'add_list_item_classes' ), 2, 2 );
100
- }
101
-
102
-
103
- /**
104
- * Add the custom classes to the list items
105
- *
106
- * @param array $classes - Provided classes for item.
107
- * @param \WP_Post $post - The item.
108
- *
109
- * @return array
110
- */
111
- public function add_list_item_classes( $classes, WP_Post $post ) {
112
- if ( $post->ID === $this->top_parent_id ) {
113
- $children = $this->get_child_pages( $post->ID, true );
114
- } else {
115
- $children = $this->get_child_pages( $post->ID );
116
- }
117
- if ( ! empty( $children ) ) {
118
- $classes[] = 'has_children';
119
- }
120
-
121
- // page posts are handled by wp core. This is for custom post types.
122
- if ( 'page' !== $post->post_type ) {
123
- $ancestors = get_post_ancestors( $post );
124
- if ( ! empty( $ancestors ) && in_array( $this->current_page->ID, $ancestors, false ) ) { //phpcs:ignore
125
- $classes[] = 'current_page_ancestor';
126
- } elseif ( $this->current_page->ID === $post->post_parent ) {
127
- $classes[] = 'current_page_parent';
128
- }
129
- }
130
-
131
- return array_unique( $classes );
132
- }
133
-
134
-
135
- /**
136
- * Return the list of args that have been populated by this class
137
- * For use with wp_list_pages()
138
- *
139
- * @param string $level - level of menu so we have full control of updates.
140
- *
141
- * @return array
142
- */
143
- public function get_args( $level = null ) {
144
- if ( null === $level ) {
145
- return $this->args;
146
- }
147
- $args = $this->args;
148
- switch ( $level ) {
149
- case Advanced_Sidebar_Menu_Menus_Page::LEVEL_PARENT:
150
- $args['include'] = $this->menu->get_top_parent_id();
151
- break;
152
- case Advanced_Sidebar_Menu_Menus_Page::LEVEL_DISPLAY_ALL:
153
- $args['child_of'] = $this->menu->get_top_parent_id();
154
- $args['depth'] = $this->menu->get_levels_to_display();
155
- $args['sort_column'] = $this->menu->get_order_by();
156
- break;
157
- }
158
-
159
- return apply_filters( 'advanced-sidebar-menu/list-pages/get-args', $args, $level, $this );
160
- }
161
-
162
-
163
- /**
164
- * Return menu which was passed to this class
165
- *
166
- * @return Advanced_Sidebar_Menu_Menus_Page
167
- */
168
- public function get_menu() {
169
- return $this->menu;
170
- }
171
-
172
-
173
- /**
174
- * __toString
175
- *
176
- * Magic method to allow using a simple echo to get output
177
- *
178
- * @return string
179
- */
180
- public function __toString() {
181
- return $this->output;
182
- }
183
-
184
-
185
- /**
186
- * Do any adjustments to class args here
187
- *
188
- * @param array $args - Arguments for walk_page_tree.
189
- *
190
- * @return array
191
- */
192
- protected function parse_args( $args ) {
193
- $defaults = array(
194
- 'exclude' => '',
195
- 'echo' => 0,
196
- 'order' => 'ASC',
197
- 'orderby' => 'menu_order, title',
198
- 'walker' => new Advanced_Sidebar_Menu_Page_Walker(),
199
- 'link_before' => '',
200
- 'link_after' => '',
201
- 'title_li' => '',
202
- 'levels' => 100,
203
- 'item_spacing' => 'preserve',
204
- 'posts_per_page' => 100,
205
- 'suppress_filters' => false,
206
- );
207
-
208
- $args = wp_parse_args( $args, $defaults );
209
-
210
- if ( is_string( $args['exclude'] ) ) {
211
- $args['exclude'] = explode( ',', $args['exclude'] );
212
- }
213
- // sanitize, mostly to keep spaces out.
214
- $args['exclude'] = preg_replace( '/[^0-9,]/', '', implode( ',', apply_filters( 'wp_list_pages_excludes', $args['exclude'] ) ) );
215
-
216
- return apply_filters( 'advanced_sidebar_menu_list_pages_args', $args, $this );
217
-
218
- }
219
-
220
-
221
- /**
222
- * List the pages very similar to wp_list_pages.
223
- *
224
- * @return string
225
- */
226
- public function list_pages() {
227
- $pages = $this->get_child_pages( $this->top_parent_id, true );
228
- foreach ( $pages as $page ) {
229
- $this->output .= walk_page_tree( array( $page ), 1, $this->current_page->ID, $this->args );
230
- $this->output .= $this->list_grandchild_pages( $page->ID, 0 );
231
- $this->output .= '</li>' . "\n";
232
- }
233
-
234
- $this->output = apply_filters( 'wp_list_pages', $this->output, $this->args, $pages );
235
- if ( ! $this->args['echo'] ) {
236
- return $this->output;
237
- }
238
- // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
239
- echo $this->output;
240
- return '';
241
- }
242
-
243
-
244
- /**
245
- * List all levels of grandchild pages up to the limit set in the widget.
246
- * All grandchild pages will be rendered inside `grandchild-sidebar-menu` uls.
247
- *
248
- * @param int $parent_page_id - Id of the page we are getting the grandchildren of.
249
- * @param int $level - Level of grandchild pages we are displaying.
250
- *
251
- * @return string
252
- */
253
- protected function list_grandchild_pages( $parent_page_id, $level ) {
254
- if ( $level >= (int) $this->args['levels'] ) {
255
- return '';
256
- }
257
- if ( ! $this->menu->display_all() && ! $this->is_current_page_ancestor( $parent_page_id ) ) {
258
- return '';
259
- }
260
- $pages = $this->get_child_pages( $parent_page_id );
261
- if ( empty( $pages ) ) {
262
- return '';
263
- }
264
-
265
- $content = sprintf( '<ul class="grandchild-sidebar-menu level-%s children">', $level );
266
-
267
- $inside = '';
268
- foreach ( $pages as $page ) {
269
- $inside .= walk_page_tree( array( $page ), 1, $this->current_page->ID, $this->args );
270
- $inside .= $this->list_grandchild_pages( $page->ID, $level + 1 );
271
- $inside .= "</li>\n";
272
- }
273
-
274
- if ( '' === $inside ) {
275
- return '';
276
- }
277
-
278
- return $content . $inside . "</ul>\n";
279
- }
280
-
281
-
282
- /**
283
- * Retrieve the child pages of specific page_id
284
- *
285
- * @param int $parent_page_id - Page id we are getting children of.
286
- * @param bool $is_first_level - Is this the first level of child pages?.
287
- *
288
- * @since 7.5.5 - Add 'advanced-sidebar-menu/list-pages/grandchild-pages' filter.
289
- *
290
- * @return WP_Post[]
291
- */
292
- public function get_child_pages( $parent_page_id, $is_first_level = false ) {
293
- // holds a unique key so Cache can distinguish calls.
294
- $this->current_children_parent = $parent_page_id;
295
-
296
- $cache = Advanced_Sidebar_Menu_Cache::instance();
297
- $child_pages = $cache->get_child_pages( $this );
298
- if ( false === $child_pages ) {
299
- $args = $this->args;
300
- $args['post_parent'] = $parent_page_id;
301
- $args['fields'] = 'ids';
302
- $args['suppress_filters'] = false;
303
- $child_pages = get_posts( $args );
304
-
305
- $cache->add_child_pages( $this, $child_pages );
306
- }
307
-
308
- $child_pages = array_map( 'get_post', (array) $child_pages );
309
-
310
- // We only filter the first level with this filter for backward pro compatibility.
311
- if ( $is_first_level ) {
312
- return apply_filters( 'advanced-sidebar-menu/list-pages/first-level-child-pages', $child_pages, $this, $this->menu );
313
- }
314
-
315
- // @since 7.5.5
316
- return apply_filters( 'advanced-sidebar-menu/list-pages/grandchild-pages', $child_pages, $this, $this->menu );
317
-
318
- }
319
-
320
-
321
- /**
322
- * Is the specified page an ancestor of the current page?
323
- *
324
- * @param int $page_id - Post id to check against.
325
- *
326
- * @return bool
327
- */
328
- public function is_current_page_ancestor( $page_id ) {
329
- $return = false;
330
- if ( ! empty( $this->current_page->ID ) ) {
331
- if ( (int) $page_id === $this->current_page->ID ) {
332
- $return = true;
333
- } elseif ( $this->current_page->post_parent === (int) $page_id ) {
334
- $return = true;
335
- } else {
336
- $ancestors = get_post_ancestors( $this->current_page );
337
- if ( ! empty( $ancestors ) && in_array( (int) $page_id, $ancestors, true ) ) {
338
- $return = true;
339
- }
340
- }
341
- }
342
-
343
- return apply_filters( 'advanced_sidebar_menu_page_ancestor', $return, $this->current_page->ID, $this );
344
- }
345
-
346
-
347
- /**
348
- * List Pages Factory
349
- *
350
- * @param \Advanced_Sidebar_Menu_Menus_Page $menu - The menu class.
351
- *
352
- * @static
353
- *
354
- * @return Advanced_Sidebar_Menu_List_Pages
355
- */
356
- public static function factory( Advanced_Sidebar_Menu_Menus_Page $menu ) {
357
- return new self( $menu );
358
- }
359
-
360
- }
7.6.1/src/Menu.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
- /**
3
- * @deprecated
4
- */
5
- class Advanced_Sidebar_Menu_Menu {
6
- /**
7
- * Advanced_Sidebar_Menu_Menu constructor.
8
- *
9
- * @deprecated
10
- */
11
- public function __construct() {
12
- _deprecated_constructor( 'Advanced_Sidebar_Menu_Menu', '7.0.0' );
13
- }
14
-
15
- /**
16
- * @deprecated
17
- */
18
- public static function get_current() {
19
- _deprecated_function( 'Advanced_Sidebar_Menu_Menu::get_current()', '7.0.0', 'Advanced_Sidebar_Menu_Menus_Abstract::get_current()' );
20
-
21
- return Advanced_Sidebar_Menu_Menus_Abstract::get_current();
22
- }
23
- }
7.6.1/src/Menus/Abstract.php DELETED
@@ -1,295 +0,0 @@
1
- <?php
2
-
3
- use Prophecy\Argument\Token\StringContainsToken;
4
-
5
- /**
6
- * Advanced_Sidebar_Menu_Menus_Abstract
7
- *
8
- * @author Mat Lipe
9
- * @since 7.0.0
10
- */
11
- abstract class Advanced_Sidebar_Menu_Menus_Abstract {
12
- // keys available in both widgets.
13
- const TITLE = 'title';
14
- const INCLUDE_PARENT = 'include_parent';
15
- const INCLUDE_CHILDLESS_PARENT = 'include_childless_parent';
16
- const ORDER = 'order';
17
- const ORDER_BY = 'order_by';
18
- const USE_PLUGIN_STYLES = 'css';
19
- const EXCLUDE = 'exclude';
20
- const DISPLAY_ALL = 'display_all';
21
- const LEVELS = 'levels';
22
-
23
- const LEVEL_CHILD = 'child';
24
- const LEVEL_DISPLAY_ALL = 'display-all';
25
- const LEVEL_GRANDCHILD = 'grandchild';
26
- const LEVEL_PARENT = 'parent';
27
-
28
- /**
29
- * Widget Args
30
- *
31
- * @var array
32
- */
33
- public $args = array();
34
-
35
- /**
36
- * @deprecated
37
- *
38
- * @var array
39
- */
40
- public $exclude = array();
41
-
42
- /**
43
- * Widget instance
44
- *
45
- * @var array
46
- */
47
- public $instance;
48
-
49
- /**
50
- * @deprecated 7.0.0
51
- *
52
- * @var string
53
- */
54
- public $order = 'ASC';
55
-
56
- /**
57
- * @deprecated 7.0.0
58
- *
59
- * @var string
60
- */
61
- public $order_by;
62
-
63
- /**
64
- * Top post_id or term_id
65
- *
66
- * @deprecated 7.0.0
67
- *
68
- * @var int
69
- */
70
- public $top_id;
71
-
72
- /**
73
- * Track the ids which have been used in case of
74
- * plugins like Elementor that we need to manually increment.
75
- *
76
- * @since 7.6.0
77
- * @ticket #4775
78
- *
79
- * @var string[]
80
- */
81
- protected static $unique_widget_ids = array();
82
-
83
-
84
- public function __construct( array $widget_instance, array $widget_args ) {
85
- $this->instance = apply_filters( 'advanced-sidebar-menu/menus/widget-instance', $widget_instance, $widget_args, $this );
86
- $this->args = $widget_args;
87
-
88
- $this->increment_widget_id();
89
- }
90
-
91
-
92
- abstract public function get_top_parent_id();
93
-
94
-
95
- abstract public function get_order_by();
96
-
97
-
98
- abstract public function get_order();
99
-
100
-
101
- abstract public function render();
102
-
103
-
104
- abstract public function is_displayed();
105
-
106
-
107
- abstract public function get_levels_to_display();
108
-
109
-
110
- /**
111
- * Increment the widget id until it is unique to all widgets being displayed
112
- * in the current context.
113
- *
114
- * Required because plugins like Elementor will reuse the same generic id for
115
- * widgets within page content and we need a unique id to properly target with
116
- * styles, accordions, etc.
117
- *
118
- * @since 7.6.0
119
- * @ticket #4775
120
- *
121
- * @return void
122
- */
123
- protected function increment_widget_id() {
124
- if ( ! isset( $this->args['widget_id'] ) ) {
125
- return;
126
- }
127
- if ( in_array( $this->args['widget_id'], self::$unique_widget_ids, true ) ) {
128
- $suffix = 2;
129
- do {
130
- $alt_widget_id = $this->args['widget_id'] . "-$suffix";
131
- $suffix ++;
132
- } while ( in_array( $alt_widget_id, self::$unique_widget_ids, true ) );
133
- $this->args['widget_id'] = $alt_widget_id;
134
- self::$unique_widget_ids[] = $alt_widget_id;
135
- } else {
136
- self::$unique_widget_ids[] = $this->args['widget_id'];
137
- }
138
- }
139
-
140
-
141
- /**
142
- * Return the type of widget we are working with
143
- * Used for comparisons like so
144
- *
145
- * $menu->get_widget_type() === Menus_Page::WIDGET
146
- *
147
- * @return string - 'page', 'category',
148
- */
149
- public function get_widget_type() {
150
- return self::WIDGET;
151
- }
152
-
153
-
154
- /**
155
- * The instance arguments from the current widget
156
- *
157
- * @return array
158
- */
159
- public function get_widget_instance() {
160
- return $this->instance;
161
- }
162
-
163
-
164
- /**
165
- * The widget arguments from the current widget
166
- *
167
- * @return array
168
- */
169
- public function get_widget_args() {
170
- return $this->args;
171
- }
172
-
173
-
174
- /**
175
- * Checks if a widgets checkbox is checked.
176
- *
177
- * Checks first for a value then verifies the value = checked
178
- *
179
- * @param string $name - name of checkbox.
180
- *
181
- * @return bool
182
- */
183
- public function checked( $name ) {
184
- return isset( $this->instance[ $name ] ) && 'checked' === $this->instance[ $name ];
185
- }
186
-
187
-
188
- /**
189
- * Determines if all the children should be included
190
- *
191
- * @return bool
192
- */
193
- public function display_all() {
194
- return $this->checked( self::DISPLAY_ALL );
195
- }
196
-
197
-
198
- /**
199
- * Determines if the parent page or cat should be included
200
- *
201
- * @return bool
202
- */
203
- public function include_parent() {
204
- return $this->checked( self::INCLUDE_PARENT ) && ! $this->is_excluded( $this->get_top_parent_id() );
205
- }
206
-
207
-
208
- /**
209
- * Is this id excluded from this menu?
210
- *
211
- * @param int $id
212
- *
213
- * @return bool
214
- */
215
- public function is_excluded( $id ) {
216
- $exclude = $this->get_excluded_ids();
217
-
218
- return in_array( (int) $id, $exclude, true );
219
- }
220
-
221
-
222
- /**
223
- * Retrieve the excluded items' ids
224
- *
225
- * @return array
226
- */
227
- public function get_excluded_ids() {
228
- $excluded = explode( ',', $this->instance[ self::EXCLUDE ] );
229
- $excluded = array_filter( $excluded );
230
- $excluded = array_filter( $excluded, 'is_numeric' );
231
- $excluded = array_map( 'intval', $excluded );
232
-
233
- return $excluded;
234
- }
235
-
236
-
237
- /**
238
- * Echos the title of the widget to the page
239
- *
240
- * @todo find somewhere more appropriate for this?
241
- */
242
- public function title() {
243
- if ( ! empty( $this->instance[ self::TITLE ] ) ) {
244
- $title = apply_filters( 'widget_title', $this->instance[ self::TITLE ], $this->args, $this->instance );
245
- $title = apply_filters( 'advanced_sidebar_menu_widget_title', esc_html( $title ), $this->args, $this->instance, $this );
246
-
247
- // phpcs:disable
248
- echo $this->args['before_title'] . $title . $this->args['after_title'];
249
- // phpcs:enable
250
- }
251
- }
252
-
253
-
254
- /**
255
- *
256
- * @static
257
- *
258
- * @var \Advanced_Sidebar_Menu_Menus_Page|\Advanced_Sidebar_Menu_Menus_Category
259
- */
260
- protected static $current;
261
-
262
-
263
- /**
264
- *
265
- * @static
266
- *
267
- * @return \Advanced_Sidebar_Menu_Menus_Page|\Advanced_Sidebar_Menu_Menus_Category
268
- */
269
- public static function get_current() {
270
- return self::$current;
271
- }
272
-
273
-
274
- /**
275
- * static() does not exist until PHP 5.3 which means we have to do
276
- * this hideous thing where we call the factory method from the child
277
- * class and pass it's name.
278
- * Chose to handle it this way instead of trying to maintain 2 separate
279
- * factory methods with logic.
280
- *
281
- * @param string $class
282
- * @param array $widget_instance
283
- * @param array $widget_args
284
- *
285
- * @static
286
- *
287
- * @return mixed
288
- */
289
- public static function _factory( $class, array $widget_instance, array $widget_args ) {
290
- $menu = new $class( $widget_instance, $widget_args );
291
- self::$current = $menu;
292
-
293
- return $menu;
294
- }
295
- }