section_nav();
$this->section_mega_items();
$this->section_mobile();
$this->section_style_nav();
$this->section_style_items();
$this->section_style_submenu();
$this->section_style_mega();
$this->section_style_mobile();
$this->section_style_hamburger();
}
// =========================================================================
// Content — Navigation
// =========================================================================
private function section_nav(): void {
$this->start_controls_section( 'section_nav', [
'label' => __( 'Navigation', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_CONTENT,
] );
$menus = wp_get_nav_menus();
$options = [];
foreach ( $menus as $menu ) {
$options[ $menu->slug ] = $menu->name;
}
$this->add_control( 'nav_menu', [
'label' => __( 'Select Menu', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'options' => empty( $options )
? [ '' => __( '— No menus found —', 'admore-widgets-suite' ) ]
: $options,
'description' => sprintf(
/* translators: %s: Menus admin URL */
__( 'Manage Menus ', 'admore-widgets-suite' ),
esc_url( admin_url( 'nav-menus.php' ) )
),
] );
$this->add_control( 'dropdown_icon', [
'label' => __( 'Dropdown Indicator Icon', 'admore-widgets-suite' ),
'type' => Controls_Manager::ICONS,
'default' => [ 'library' => 'eicons', 'value' => 'eicon-chevron-down' ],
] );
$this->add_control( 'layout', [
'label' => __( 'Layout', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'horizontal',
'options' => [
'horizontal' => __( 'Horizontal', 'admore-widgets-suite' ),
'vertical' => __( 'Vertical', 'admore-widgets-suite' ),
],
] );
$this->add_control( 'alignment', [
'label' => __( 'Alignment', 'admore-widgets-suite' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [ 'title' => __( 'Left', 'admore-widgets-suite' ), 'icon' => 'eicon-align-start-h' ],
'center' => [ 'title' => __( 'Center', 'admore-widgets-suite' ), 'icon' => 'eicon-align-center-h' ],
'flex-end' => [ 'title' => __( 'Right', 'admore-widgets-suite' ), 'icon' => 'eicon-align-end-h' ],
],
'default' => 'flex-start',
'selectors' => [ '{{WRAPPER}} .eppro-mega-menu-list' => 'justify-content: {{VALUE}};' ],
] );
$this->add_control( 'dropdown_animation', [
'label' => __( 'Dropdown Animation', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'fade-up',
'options' => [
'none' => __( 'None', 'admore-widgets-suite' ),
'fade' => __( 'Fade', 'admore-widgets-suite' ),
'fade-up' => __( 'Fade + Slide Up','admore-widgets-suite' ),
'zoom' => __( 'Zoom In', 'admore-widgets-suite' ),
],
'separator' => 'before',
] );
$this->end_controls_section();
}
// =========================================================================
// Content — Mega Panels Repeater
// =========================================================================
private function section_mega_items(): void {
$this->start_controls_section( 'section_mega_items', [
'label' => __( 'Mega Panels', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_CONTENT,
] );
$this->add_control( 'mega_notice', [
'type' => Controls_Manager::RAW_HTML,
'raw' => '
'
. __( 'How to use: 1. Go to Appearance → Menus , hover over a menu item and note its ID from the URL (e.g. menu-item=123). 2. Create a saved template in Templates → Saved Templates . 3. Add a panel row below using that ID and template.', 'admore-widgets-suite' )
. '
',
'content_classes' => 'elementor-descriptor',
] );
$templates = self::get_elementor_templates();
$repeater = new Repeater();
$repeater->add_control( 'item_id', [
'label' => __( 'Menu Item ID', 'admore-widgets-suite' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'placeholder' => '123',
] );
$repeater->add_control( 'mega_label', [
'label' => __( 'Label (reference only)', 'admore-widgets-suite' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'e.g. Products', 'admore-widgets-suite' ),
] );
$repeater->add_control( 'template_id', [
'label' => __( 'Elementor Template', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'options' => $templates,
] );
$repeater->add_control( 'panel_width', [
'label' => __( 'Panel Width', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'full',
'options' => [
'full' => __( 'Full Width (100vw)', 'admore-widgets-suite' ),
'wide' => __( 'Wide (80vw)', 'admore-widgets-suite' ),
'medium' => __( 'Medium (600px)', 'admore-widgets-suite' ),
'auto' => __( 'Auto', 'admore-widgets-suite' ),
],
] );
$repeater->add_control( 'panel_columns', [
'label' => __( 'Columns', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => __( '1 Column', 'admore-widgets-suite' ),
'2' => __( '2 Columns', 'admore-widgets-suite' ),
'3' => __( '3 Columns', 'admore-widgets-suite' ),
'4' => __( '4 Columns', 'admore-widgets-suite' ),
],
] );
$repeater->add_control( 'panel_align', [
'label' => __( 'Panel Position', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'left',
'options' => [
'left' => __( 'Align from Item (left)', 'admore-widgets-suite' ),
'center' => __( 'Centered', 'admore-widgets-suite' ),
'right' => __( 'Align from Item (right)', 'admore-widgets-suite' ),
'full' => __( 'Full Width', 'admore-widgets-suite' ),
],
] );
$this->add_control( 'mega_items', [
'label' => __( 'Panels', 'admore-widgets-suite' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => [],
'title_field' => '{{{ mega_label || ("Item #" + item_id) }}}',
] );
$this->end_controls_section();
}
// =========================================================================
// Content — Mobile
// =========================================================================
private function section_mobile(): void {
$this->start_controls_section( 'section_mobile', [
'label' => __( 'Mobile', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_CONTENT,
] );
$this->add_control( 'mobile_breakpoint', [
'label' => __( 'Mobile Breakpoint (px)', 'admore-widgets-suite' ),
'type' => Controls_Manager::NUMBER,
'default' => 768,
] );
$this->add_control( 'mobile_animation', [
'label' => __( 'Panel Animation', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'slide',
'options' => [
'slide' => __( 'Slide In', 'admore-widgets-suite' ),
'fade' => __( 'Fade', 'admore-widgets-suite' ),
],
] );
$this->add_control( 'hamburger_style', [
'label' => __( 'Hamburger Style', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'three-lines',
'options' => [
'three-lines' => __( 'Three Lines', 'admore-widgets-suite' ),
'two-lines' => __( 'Two Lines', 'admore-widgets-suite' ),
],
] );
$this->add_control( 'show_overlay', [
'label' => __( 'Show Overlay', 'admore-widgets-suite' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'return_value' => 'yes',
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Nav Wrapper
// =========================================================================
private function section_style_nav(): void {
$this->start_controls_section( 'style_nav', [
'label' => __( 'Nav Wrapper', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'nav_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-mega-nav' => 'background-color: {{VALUE}};' ],
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'nav_shadow',
'selector' => '{{WRAPPER}} .eppro-mega-nav',
] );
$this->add_responsive_control( 'nav_padding', [
'label' => __( 'Padding', 'admore-widgets-suite' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em' ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-nav' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'item_gap', [
'label' => __( 'Item Gap', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'default' => [ 'size' => 8 ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-menu-list' => 'gap: {{SIZE}}{{UNIT}};' ],
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Menu Items
// =========================================================================
private function section_style_items(): void {
$this->start_controls_section( 'style_items', [
'label' => __( 'Menu Items', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'item_typography',
'selector' => '{{WRAPPER}} .eppro-mega-link',
] );
$this->start_controls_tabs( 'item_tabs' );
$this->start_controls_tab( 'item_normal', [ 'label' => __( 'Normal', 'admore-widgets-suite' ) ] );
$this->add_control( 'item_color', [
'label' => __( 'Text Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#1f2937',
'selectors' => [ '{{WRAPPER}} .eppro-mega-link' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'item_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-mega-link' => 'background-color: {{VALUE}};' ],
] );
$this->end_controls_tab();
$this->start_controls_tab( 'item_hover', [ 'label' => __( 'Hover / Active', 'admore-widgets-suite' ) ] );
$this->add_control( 'item_hover_color', [
'label' => __( 'Text Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#7c3aed',
'selectors' => [
'{{WRAPPER}} .eppro-mega-link:hover' => 'color: {{VALUE}};',
'{{WRAPPER}} .eppro-mega-item--active > .eppro-mega-link' => 'color: {{VALUE}};',
],
] );
$this->add_control( 'item_hover_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .eppro-mega-link:hover' => 'background-color: {{VALUE}};',
'{{WRAPPER}} .eppro-mega-item--active > .eppro-mega-link' => 'background-color: {{VALUE}};',
],
] );
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control( 'item_padding', [
'label' => __( 'Padding', 'admore-widgets-suite' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em' ],
'default' => [ 'top' => '10', 'right' => '16', 'bottom' => '10', 'left' => '16', 'unit' => 'px', 'isLinked' => false ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
'separator' => 'before',
] );
$this->add_control( 'item_radius', [
'label' => __( 'Border Radius', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'default' => [ 'size' => 4 ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-link' => 'border-radius: {{SIZE}}{{UNIT}};' ],
] );
$this->add_control( 'dropdown_icon_heading', [
'label' => __( 'Dropdown Icon', 'admore-widgets-suite' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
] );
$this->add_control( 'dropdown_icon_color', [
'label' => __( 'Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#6b7280',
'selectors' => [
'{{WRAPPER}} .eppro-submenu-toggle i' => 'color: {{VALUE}};',
'{{WRAPPER}} .eppro-submenu-toggle svg' => 'fill: {{VALUE}};',
],
] );
$this->add_control( 'dropdown_icon_hover_color', [
'label' => __( 'Hover Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .eppro-mega-item--has-dropdown:hover .eppro-submenu-toggle i' => 'color: {{VALUE}};',
'{{WRAPPER}} .eppro-mega-item--has-dropdown:hover .eppro-submenu-toggle svg' => 'fill: {{VALUE}};',
],
] );
$this->add_control( 'dropdown_icon_size', [
'label' => __( 'Size (px)', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'range' => [ 'px' => [ 'min' => 8, 'max' => 32 ] ],
'default' => [ 'size' => 14 ],
'selectors' => [
'{{WRAPPER}} .eppro-submenu-toggle i' => 'font-size: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .eppro-submenu-toggle svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
],
] );
$this->add_control( 'active_indicator_heading', [
'label' => __( 'Active Item Indicator', 'admore-widgets-suite' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
] );
$this->add_control( 'active_indicator_type', [
'label' => __( 'Style', 'admore-widgets-suite' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => [
'none' => __( 'None', 'admore-widgets-suite' ),
'underline' => __( 'Underline', 'admore-widgets-suite' ),
'top-border' => __( 'Top Border', 'admore-widgets-suite' ),
'left-border'=> __( 'Left Border', 'admore-widgets-suite' ),
],
] );
$this->add_control( 'active_indicator_color', [
'label' => __( 'Indicator Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#7c3aed',
'selectors' => [
'{{WRAPPER}} .eppro-indicator-underline .eppro-mega-item--active > .eppro-mega-link' => 'border-bottom: 2px solid {{VALUE}};',
'{{WRAPPER}} .eppro-indicator-top-border .eppro-mega-item--active > .eppro-mega-link' => 'border-top: 3px solid {{VALUE}};',
'{{WRAPPER}} .eppro-indicator-left-border .eppro-mega-item--active > .eppro-mega-link'=> 'border-left: 3px solid {{VALUE}};',
],
'condition' => [ 'active_indicator_type!' => 'none' ],
] );
$this->add_control( 'active_indicator_size', [
'label' => __( 'Thickness (px)', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'range' => [ 'px' => [ 'min' => 1, 'max' => 8 ] ],
'default' => [ 'size' => 2 ],
'selectors' => [
'{{WRAPPER}} .eppro-indicator-underline .eppro-mega-item--active > .eppro-mega-link' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .eppro-indicator-top-border .eppro-mega-item--active > .eppro-mega-link' => 'border-top-width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .eppro-indicator-left-border .eppro-mega-item--active > .eppro-mega-link'=> 'border-left-width: {{SIZE}}{{UNIT}};',
],
'condition' => [ 'active_indicator_type!' => 'none' ],
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Sub-menu Items
// =========================================================================
private function section_style_submenu(): void {
$this->start_controls_section( 'style_submenu', [
'label' => __( 'Sub-menu Items', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_group_control( Group_Control_Typography::get_type(), [
'name' => 'submenu_typography',
'selector' => '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link',
] );
$this->start_controls_tabs( 'submenu_item_tabs' );
$this->start_controls_tab( 'submenu_item_normal', [ 'label' => __( 'Normal', 'admore-widgets-suite' ) ] );
$this->add_control( 'submenu_item_color', [
'label' => __( 'Text Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'submenu_item_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link' => 'background-color: {{VALUE}};' ],
] );
$this->end_controls_tab();
$this->start_controls_tab( 'submenu_item_hover', [ 'label' => __( 'Hover', 'admore-widgets-suite' ) ] );
$this->add_control( 'submenu_item_hover_color', [
'label' => __( 'Text Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link:hover' => 'color: {{VALUE}};' ],
] );
$this->add_control( 'submenu_item_hover_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'selectors' => [ '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link:hover' => 'background-color: {{VALUE}};' ],
] );
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control( 'submenu_item_padding', [
'label' => __( 'Padding', 'admore-widgets-suite' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em' ],
'selectors' => [ '{{WRAPPER}} .eppro-sub-menu .eppro-mega-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
'separator' => 'before',
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Mobile Drawer
// =========================================================================
private function section_style_mobile(): void {
$this->start_controls_section( 'style_mobile', [
'label' => __( 'Mobile Drawer', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'mobile_drawer_bg', [
'label' => __( 'Drawer Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [ '{{WRAPPER}} .eppro-mega-nav--mobile' => 'background-color: {{VALUE}};' ],
] );
$this->add_control( 'mobile_overlay_color', [
'label' => __( 'Overlay Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => 'rgba(0,0,0,0.4)',
'selectors' => [ '{{WRAPPER}} .eppro-mega-overlay' => 'background-color: {{VALUE}};' ],
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'mobile_drawer_shadow',
'selector' => '{{WRAPPER}} .eppro-mega-nav--mobile',
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Mega Panel
// =========================================================================
private function section_style_mega(): void {
$this->start_controls_section( 'style_mega', [
'label' => __( 'Mega Panel', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'mega_bg', [
'label' => __( 'Background', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#ffffff',
'selectors' => [ '{{WRAPPER}} .eppro-mega-panel' => 'background-color: {{VALUE}};' ],
] );
$this->add_group_control( Group_Control_Box_Shadow::get_type(), [
'name' => 'mega_shadow',
'selector' => '{{WRAPPER}} .eppro-mega-panel',
] );
$this->add_group_control( Group_Control_Border::get_type(), [
'name' => 'mega_border',
'selector' => '{{WRAPPER}} .eppro-mega-panel',
] );
$this->add_control( 'mega_radius', [
'label' => __( 'Border Radius', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'default' => [ 'size' => 8 ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-panel' => 'border-radius: 0 0 {{SIZE}}{{UNIT}} {{SIZE}}{{UNIT}};' ],
] );
$this->add_responsive_control( 'mega_padding', [
'label' => __( 'Inner Padding', 'admore-widgets-suite' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em' ],
'default' => [ 'top' => '24', 'right' => '24', 'bottom' => '24', 'left' => '24', 'unit' => 'px', 'isLinked' => true ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-panel' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ],
] );
$this->add_control( 'mega_offset', [
'label' => __( 'Vertical Offset (px)', 'admore-widgets-suite' ),
'type' => Controls_Manager::NUMBER,
'default' => 0,
'selectors' => [ '{{WRAPPER}} .eppro-mega-panel' => 'margin-top: {{VALUE}}px;' ],
] );
$this->end_controls_section();
}
// =========================================================================
// Style — Hamburger
// =========================================================================
private function section_style_hamburger(): void {
$this->start_controls_section( 'style_hamburger', [
'label' => __( 'Hamburger', 'admore-widgets-suite' ),
'tab' => Controls_Manager::TAB_STYLE,
] );
$this->add_control( 'hamburger_color', [
'label' => __( 'Line Color', 'admore-widgets-suite' ),
'type' => Controls_Manager::COLOR,
'default' => '#1f2937',
'selectors' => [ '{{WRAPPER}} .eppro-hamburger-line' => 'background-color: {{VALUE}};' ],
] );
$this->add_responsive_control( 'hamburger_size', [
'label' => __( 'Size (px)', 'admore-widgets-suite' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'default' => [ 'size' => 28 ],
'selectors' => [ '{{WRAPPER}} .eppro-mega-hamburger' => 'width: {{SIZE}}{{UNIT}};' ],
] );
$this->end_controls_section();
}
// =========================================================================
// Render
// =========================================================================
protected function render(): void {
$s = $this->get_settings_for_display();
$menu_key = $s['nav_menu'] ?? '';
if ( empty( $menu_key ) ) {
if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
echo '
' . esc_html__( 'Mega Menu', 'admore-widgets-suite' ) . '
' . esc_html__( 'Select a menu from the widget settings.', 'admore-widgets-suite' ) . '
';
}
return;
}
// Build mega config: [ item_id => config_array ]
$mega_config = [];
foreach ( $s['mega_items'] ?? [] as $item ) {
$id = absint( $item['item_id'] ?? 0 );
if ( $id > 0 ) {
$mega_config[ $id ] = [
'template_id' => absint( $item['template_id'] ?? 0 ),
'panel_width' => sanitize_key( $item['panel_width'] ?? 'full' ),
'panel_columns' => absint( $item['panel_columns'] ?? 3 ),
'panel_align' => sanitize_key( $item['panel_align'] ?? 'left' ),
];
}
}
$layout = sanitize_key( $s['layout'] ?? 'horizontal' );
$anim = sanitize_key( $s['mobile_animation'] ?? 'slide' );
$mobile_bp = absint( $s['mobile_breakpoint'] ?? 768 );
$h_style = sanitize_key( $s['hamburger_style'] ?? 'three-lines' );
$dropdown_anim = sanitize_key( $s['dropdown_animation'] ?? 'fade-up' );
$indicator_type = sanitize_key( $s['active_indicator_type'] ?? 'none' );
$wrap_classes = [ 'eppro-mega-menu-wrap', 'layout-' . $layout ];
if ( 'fade' === $anim ) {
$wrap_classes[] = 'anim-fade';
}
if ( 'none' !== $dropdown_anim ) {
$wrap_classes[] = 'eppro-dropdown-' . $dropdown_anim;
}
if ( 'none' !== $indicator_type ) {
$wrap_classes[] = 'eppro-indicator-' . $indicator_type;
}
// Capture dropdown icon HTML for JS injection
$dropdown_icon_html = '';
if ( ! empty( $s['dropdown_icon']['value'] ) ) {
ob_start();
\Elementor\Icons_Manager::render_icon( $s['dropdown_icon'], [ 'aria-hidden' => 'true' ] );
$dropdown_icon_html = ob_get_clean();
}
require_once dirname( __FILE__ ) . '/class-mega-walker.php';
?>
$menu_key,
'menu_class' => 'eppro-mega-menu-list',
'container' => false,
'walker' => new EPPRO_Mega_Menu_Walker( $mega_config ),
'fallback_cb' => false,
'items_wrap' => '',
] );
?>
title options array.
*/
public static function get_elementor_templates(): array {
$options = [ '' => __( '— Select Template —', 'admore-widgets-suite' ) ];
$posts = get_posts( [
'post_type' => 'elementor_library',
'post_status' => 'publish',
'posts_per_page' => 200,
'orderby' => 'title',
'order' => 'ASC',
'fields' => 'ids',
] );
foreach ( $posts as $id ) {
$options[ $id ] = get_the_title( $id );
}
return $options;
}
}