PluginProbe
QuadMenu – Mega Menu / 3.3.8
QuadMenu – Mega Menu v3.3.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / lib / frontend / walker / class-quadmenu-item-mega.php

class-quadmenu-item-mega.php in QuadMenu – Mega Menu 3.3.8, at lib/frontend/walker/class-quadmenu-item-mega.php

70 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace QuadLayers\QuadMenu\Frontend\Walker;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7 use QuadLayers\QuadMenu\Frontend\Walker\QuadMenu_Item;
8
9 /**
10 * QuadMenuItemMega Class
11 */
12 class QuadMenu_Item_Mega extends QuadMenu_Item {
13
14 protected $type = 'mega';
15
16 function init() {
17 $this->args->has_background = ( 0 === $this->depth && isset( $this->item->background['thumbnail-id'] ) && is_array( wp_get_attachment_image_src( $this->item->background['thumbnail-id'], 'full' ) ) );
18 }
19
20 function get_start_el() {
21
22 $item_output = '';
23
24 $this->add_item_classes();
25
26 $this->add_item_classes_prefix();
27
28 $this->add_item_classes_quadmenu();
29
30 $this->add_item_classes_maxheight();
31
32 $this->add_item_dropdown_width();
33
34 $id = $this->get_item_id();
35
36 $class = $this->get_item_classes();
37
38 $item_output .= '<li' . $id . $class . '>';
39
40 $this->add_link_atts();
41
42 $this->add_link_atts_toggle();
43
44 $item_output .= $this->get_link();
45
46 // $this->add_dropdown_background();
47
48 return $item_output;
49 }
50
51 function add_item_dropdown_width() {
52
53 if ( ! empty( $this->item->stretch ) ) {
54 $this->dropdown_classes[] = 'quadmenu-dropdown-stretch-' . $this->item->stretch;
55 }
56
57 if ( empty( $this->item->stretch ) && ! empty( $this->item->columns ) ) {
58 $this->dropdown_classes = array_merge( $this->dropdown_classes, $this->item->columns );
59 }
60
61 if ( empty( $this->item->stretch ) && empty( $this->item->columns ) ) {
62 $this->dropdown_classes[] = 'quadmenu-dropdown-stretch-boxed';
63 }
64 }
65
66 function add_item_dropdown_ul_classes() {
67 $this->dropdown_ul_classes[] = 'quadmenu-row';
68 }
69 }
70