PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.8
Shortcodes and extra features for Phlox theme v2.5.8
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / classes / class-auxin-walker-nav-menu-back.php
auxin-elements / includes / classes Last commit date
class-auxels-admin-assets.php 6 years ago class-auxels-archive-menu-links.php 6 years ago class-auxels-import-parser.php 8 years ago class-auxels-import.php 6 years ago class-auxels-search-post-type.php 6 years ago class-auxin-admin-dashboard.php 6 years ago class-auxin-demo-importer.php 6 years ago class-auxin-dependency-sorting.php 8 years ago class-auxin-import.php 6 years ago class-auxin-install.php 6 years ago class-auxin-master-nav-menu-admin.php 6 years ago class-auxin-page-template.php 6 years ago class-auxin-permalink.php 6 years ago class-auxin-plugin-requirements.php 6 years ago class-auxin-post-type-base.php 6 years ago class-auxin-siteorigin-widget.php 6 years ago class-auxin-svg-support-allowedattributes.php 7 years ago class-auxin-svg-support-allowedtags.php 7 years ago class-auxin-svg-support.php 7 years ago class-auxin-walker-nav-menu-back.php 6 years ago class-auxin-welcome-sections.php 6 years ago class-auxin-welcome.php 6 years ago class-auxin-whitelabel.php 6 years ago class-auxin-widget-indie.php 6 years ago class-auxin-widget-shortcode-map.php 6 years ago class-auxin-widget.php 6 years ago
class-auxin-walker-nav-menu-back.php
389 lines
1 <?php
2 /**
3 * Create HTML list of custom nav menu input items.
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2020 averta
11 */
12 class Auxin_Walker_Nav_Menu_Back extends Walker_Nav_Menu {
13
14 /**
15 * List of custom meta fields for menu items
16 *
17 * @var array
18 */
19 protected $menu_item_fields;
20
21
22 /**
23 * Starts the list before the elements are added.
24 *
25 * @see Walker_Nav_Menu::start_lvl()
26 *
27 * @since 3.0.0
28 *
29 * @param string $output Passed by reference.
30 * @param int $depth Depth of menu item. Used for padding.
31 * @param array $args Not used.
32 */
33 public function start_lvl( &$output, $depth = 0, $args = array() ) {}
34
35
36 /**
37 * Ends the list of after the elements are added.
38 *
39 * @see Walker_Nav_Menu::end_lvl()
40 *
41 * @since 3.0.0
42 *
43 * @param string $output Passed by reference.
44 * @param int $depth Depth of menu item. Used for padding.
45 * @param array $args Not used.
46 */
47 public function end_lvl( &$output, $depth = 0, $args = array() ) {}
48
49
50 /**
51 * Start the element output.
52 *
53 * @see Walker_Nav_Menu::start_el()
54 * @since 3.0.0
55 *
56 * @global int $_wp_nav_menu_max_depth
57 *
58 * @param string $output Passed by reference. Used to append additional content.
59 * @param object $item Menu item data object.
60 * @param int $depth Depth of menu item. Used for padding.
61 * @param array $args Not used.
62 * @param int $id Not used.
63 */
64 public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
65
66 $this->menu_item_fields = Auxin_Master_Nav_Menu::get_instance()->menu_item_fields; //@Edit
67
68 global $_wp_nav_menu_max_depth;
69 $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
70
71 ob_start();
72 $item_id = esc_attr( $item->ID );
73 $removed_args = array(
74 'action',
75 'customlink-tab',
76 'edit-menu-item',
77 'menu-item',
78 'page-tab',
79 '_wpnonce',
80 );
81
82 $original_title = '';
83 if ( 'taxonomy' == $item->type ) {
84 $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
85 if ( is_wp_error( $original_title ) )
86 $original_title = false;
87 } elseif ( 'post_type' == $item->type ) {
88 $original_object = get_post( $item->object_id );
89 $original_title = get_the_title( $original_object->ID );
90 }
91
92 $classes = array(
93 'menu-item menu-item-depth-' . $depth,
94 'menu-item-' . esc_attr( $item->object ),
95 'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive'),
96 );
97
98 $title = $item->title;
99
100 if ( ! empty( $item->_invalid ) ) {
101 $classes[] = 'menu-item-invalid';
102 /* translators: %s: title of menu item which is invalid */
103 $title = sprintf( __( '%s (Invalid)', 'auxin-elements' ), $item->title );
104 } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
105 $classes[] = 'pending';
106 /* translators: %s: title of menu item in draft status */
107 $title = sprintf( __('%s (Pending)', 'auxin-elements'), $item->title );
108 }
109
110 $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
111
112 $submenu_text = '';
113 if ( 0 == $depth )
114 $submenu_text = 'style="display: none;"';
115
116 ?>
117 <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo esc_attr( implode(' ', $classes ) ); ?>">
118 <div class="menu-item-bar">
119 <div class="menu-item-handle">
120 <span class="item-title">
121 <span class="menu-item-title"><?php echo esc_html( $title ); ?></span>
122 <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item', 'auxin-elements' ); ?></span>
123 </span>
124 <span class="item-controls">
125 <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
126
127 <span class="item-type aux-mm-mega-badge"><?php _e( 'Mega' , 'auxin-elements' ); //@Edit ?></span>
128 <span class="item-type aux-mm-col-badge" ><?php _e( 'Column', 'auxin-elements' ); //@Edit ?></span>
129
130 <span class="item-order hide-if-js">
131 <a href="<?php
132 echo wp_nonce_url(
133 add_query_arg(
134 array(
135 'action' => 'move-up-menu-item',
136 'menu-item' => $item_id,
137 ),
138 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
139 ),
140 'move-menu_item'
141 );
142 ?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up', 'auxin-elements'); ?>">&#8593;</abbr></a>
143 |
144 <a href="<?php
145 echo wp_nonce_url(
146 add_query_arg(
147 array(
148 'action' => 'move-down-menu-item',
149 'menu-item' => $item_id,
150 ),
151 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
152 ),
153 'move-menu_item'
154 );
155 ?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down', 'auxin-elements'); ?>">&#8595;</abbr></a>
156 </span>
157 <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php esc_attr_e('Edit Menu Item', 'auxin-elements'); ?>" href="<?php
158 echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
159 ?>"><?php _e( 'Edit Menu Item', 'auxin-elements' ); ?></a>
160 </span>
161 </div>
162 </div>
163
164 <div class="menu-item-settings wp-clearfix" id="menu-item-settings-<?php echo $item_id; ?>">
165 <?php if ( 'custom' == $item->type ) : ?>
166 <p class="field-url `ption description-wide">
167 <label for="edit-menu-item-url-<?php echo $item_id; ?>">
168 <?php _e( 'URL', 'auxin-elements' ); ?><br />
169 <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
170 </label>
171 </p>
172 <?php endif; ?>
173 <p class="description description-wide">
174 <label for="edit-menu-item-title-<?php echo $item_id; ?>">
175 <?php _e( 'Navigation Label', 'auxin-elements' ); ?><br />
176 <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
177 </label>
178 </p>
179 <p class="field-title-attribute description description-wide">
180 <label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
181 <?php _e( 'Title Attribute', 'auxin-elements' ); ?><br />
182 <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
183 </label>
184 </p>
185 <p class="field-link-target description">
186 <label for="edit-menu-item-target-<?php echo $item_id; ?>">
187 <input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?>" value="_blank" name="menu-item-target[<?php echo $item_id; ?>]"<?php checked( $item->target, '_blank' ); ?> />
188 <?php _e( 'Open link in a new window/tab', 'auxin-elements' ); ?>
189 </label>
190 </p>
191 <p class="field-css-classes description description-thin">
192 <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
193 <?php _e( 'CSS Classes (optional)', 'auxin-elements' ); ?><br />
194 <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode(' ', $item->classes ) ); ?>" />
195 </label>
196 </p>
197 <p class="field-xfn description description-thin">
198 <label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
199 <?php _e( 'Link Relationship (XFN)', 'auxin-elements' ); ?><br />
200 <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->xfn ); ?>" />
201 </label>
202 </p>
203 <p class="field-description description description-wide">
204 <label for="edit-menu-item-description-<?php echo $item_id; ?>">
205 <?php _e( 'Description', 'auxin-elements' ); ?><br />
206 <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
207 <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.', 'auxin-elements'); ?></span>
208 </label>
209 </p>
210
211
212
213 <div class="aux-master-menu-setting-wrapper">
214 <?php
215 foreach ( $this->menu_item_fields as $field_id => $field_info ) {
216
217 if( isset( $field_info['visible'] ) && ! in_array( $item->object, $field_info['visible'] ) ){
218 continue;
219 }
220
221 if( ! isset( $field_info['min_depth'] ) ){
222 $field_info['min_depth'] = 0;
223 }
224 if( ! isset( $field_info['max_depth'] ) ){
225 $field_info['max_depth'] = 100;
226 }
227
228 // skip if it does not meet minimum or maximum depth requirements
229 if( (int)$field_info['min_depth'] > $depth || (int)$field_info['max_depth'] < $depth ){
230 //continue;
231 }
232
233 if( ! isset( $field_info['type'] ) ){
234 $field_info['type'] = 'text';
235 }
236
237 if( ! isset( $field_info['default'] ) ){
238 $field_info['default'] = '';
239 }
240
241 $data_depth = 'data-min-depth="' . $field_info['min_depth'] . '" ';
242 $data_depth .= 'data-max-depth="' . $field_info['max_depth'] . '" ';
243
244 switch ( $field_info['type'] ) {
245
246 case 'switch':
247
248 $field_info['type'] = 'checkbox';
249 ?>
250 <p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
251 <label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
252 <input type="checkbox" id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" <?php checked( $item->{$field_id}, '1' ); ?> />
253 <?php echo $field_info['label']; ?>
254 </label>
255 </p>
256
257 <?php
258 break;
259
260 case 'select':
261
262 if( ! isset( $field_info['choices'] ) ){
263 $field_info['choices'] = array();
264 }
265 ?>
266 <p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
267 <label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
268 <?php echo $field_info['label']; ?>
269 </label>
270 <select id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" >
271 <?php
272 foreach ( $field_info['choices'] as $choice_id => $choice_value ) {
273 echo '<option value="'. $choice_id .'" ' .selected( $item->{$field_id}, $choice_id, false ) .' >'. $choice_value . '</option>';
274 }
275 ?>
276 </select>
277 </p>
278
279 <?php
280 break;
281
282 case 'icon':
283 $font_icons = Auxin()->Font_Icons->get_icons_list('fontastic');
284
285 if( ! isset( $field_info['choices'] ) ){
286 $field_info['choices'] = array();
287 }
288 ?>
289 <p class="field-<?php echo $field_id; ?> description aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
290 <label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
291 <select id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" class="aux-fonticonpicker" >
292 <?php
293 echo '<option value="">' . __( 'Choose', 'auxin-elements' ) . '</option>';
294
295 if( is_array( $font_icons ) ){
296 foreach ( $font_icons as $icon ) {
297 $icon_id = trim( $icon->classname, '.' );
298 echo '<option value="'. $icon_id .'" '. selected( $item->{$field_id}, $icon_id, false ) .' >'. $icon->name . '</option>';
299 }
300 }
301 ?>
302 </select>
303 <?php echo $field_info['label']; ?>
304 </label>
305 </p>
306
307 <?php
308 break;
309
310 case 'textarea':
311 ?>
312 <p class="field-<?php echo $field_id; ?> description description-wide aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?> >
313 <label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
314 <?php echo $field_info['label']; ?><br />
315 <textarea id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" class="widefat edit-menu-item-<?php echo $field_id; ?>" rows="3" cols="20" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" ><?php echo esc_html( $item->{$field_id} ); // textarea_escaped ?></textarea>
316 </label>
317 </p>
318
319 <?php
320 break;
321
322 case 'text':
323 default:
324 ?>
325
326 <p class="description description-wide aux-mm-setting-field-<?php echo $field_info['type']; ?> aux-mm-setting-<?php echo $field_id; ?>" <?php echo $data_depth; ?>>
327 <label for="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>">
328 <?php echo $field_info['label']; ?><br />
329 <input type="text" id="edit-menu-item-<?php echo $field_id; ?>-<?php echo $item_id; ?>" class="widefat edit-menu-item-<?php echo $field_id; ?>" name="menu-item-<?php echo $field_id; ?>[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->{$field_id} ); ?>" />
330 </label>
331 </p>
332
333 <?php
334 break;
335 }
336
337 }
338 ?>
339 </div>
340
341
342
343 <p class="field-move hide-if-no-js description description-wide">
344 <label>
345 <span><?php _e( 'Move', 'auxin-elements' ); ?></span>
346 <a href="#" class="menus-move menus-move-up" data-dir="up"><?php _e( 'Up one', 'auxin-elements' ); ?></a>
347 <a href="#" class="menus-move menus-move-down" data-dir="down"><?php _e( 'Down one', 'auxin-elements' ); ?></a>
348 <a href="#" class="menus-move menus-move-left" data-dir="left"></a>
349 <a href="#" class="menus-move menus-move-right" data-dir="right"></a>
350 <a href="#" class="menus-move menus-move-top" data-dir="top"><?php _e( 'To the top', 'auxin-elements' ); ?></a>
351 </label>
352 </p>
353
354 <div class="menu-item-actions description-wide submitbox">
355 <?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
356 <p class="link-to-original">
357 <?php printf( __('Original: %s', 'auxin-elements'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
358 </p>
359 <?php endif; ?>
360 <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
361 echo wp_nonce_url(
362 add_query_arg(
363 array(
364 'action' => 'delete-menu-item',
365 'menu-item' => $item_id,
366 ),
367 admin_url( 'nav-menus.php' )
368 ),
369 'delete-menu_item_' . $item_id
370 ); ?>"><?php _e( 'Remove', 'auxin-elements' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array( 'edit-menu-item' => $item_id, 'cancel' => time() ), admin_url( 'nav-menus.php' ) ) );
371 ?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Cancel', 'auxin-elements'); ?></a>
372 </div>
373
374 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo esc_attr( $item_id ); ?>]" value="<?php echo esc_Attr( $item_id ); ?>" />
375 <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
376 <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
377 <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
378 <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
379 <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
380
381
382 </div><!-- .menu-item-settings-->
383 <ul class="menu-item-transport"></ul>
384 <?php
385 $output .= ob_get_clean();
386 }
387
388 }
389