settings->get( 'disable_megamenu' ) ) { add_filter( 'avada_menu_options', array( $this, 'add_megamenu_fields' ), 20, 4 ); } // Add the menu arrow highlights. add_filter( 'avada_menu_arrow_hightlight', array( $this, 'add_menu_arrow_highlight' ), 10, 2 ); } /** * Register megamenu javascript assets. * * @since 3.4 * @access public * @param string $hook The hook we're currently on. * @return void */ public function register_scripts( $hook ) { if ( 'nav-menus.php' === $hook ) { // Scripts. wp_enqueue_media(); wp_register_script( 'avada-megamenu', Avada::$template_dir_url . '/assets/admin/js/mega-menu.js', array(), self::$theme_info->get( 'Version' ) ); wp_enqueue_script( 'avada-megamenu' ); } } /** * Enqueue megamenu stylesheets * * @since 3.4 * @access public * @param string $hook The hook we're currently on. * @return void */ public function register_stylesheets( $hook ) { if ( 'nav-menus.php' === $hook ) { wp_enqueue_style( 'avada-megamenu', Avada::$template_dir_url . '/assets/css/mega-menu.css', false, self::$theme_info->get( 'Version' ) ); } } /** * Adds the menu button fields. * * @access public * @param string $item_id The ID of the menu item. * @param object $item The menu item object. * @param int $depth The depth of the current item in the menu. * @param array $args Menu arguments. * @return void. */ public function add_menu_button_fields( $item_id, $item, $depth, $args ) { $name = 'menu-item-fusion-megamenu-style'; ?>

Menu > Main Menu Icons.', 'Avada' ); ?>

settings->get( 'menu_highlight_style' ); $header_layout = Avada()->settings->get( 'header_layout' ); $svg = ''; if ( 'arrow' === $menu_highlight_style && 'v6' !== $header_layout ) { $header_position = Avada()->settings->get( 'header_position' ); $svg_height = Fusion_Sanitize::size( Avada()->settings->get( 'menu_arrow_size', 'height' ) ); $svg_height_int = intval( $svg_height ); $svg_width = Fusion_Sanitize::size( Avada()->settings->get( 'menu_arrow_size', 'width' ) ); $svg_width_int = intval( $svg_width ); $svg_bg = 'fill="' . Fusion_Sanitize::color( Avada()->settings->get( 'header_bg_color' ) ) . '"'; $svg_border_color = Fusion_Sanitize::color( Avada()->settings->get( 'header_border_color' ) ); $svg_border = ''; $header_2_3_border = ( 'v2' === $header_layout || 'v3' === $header_layout ); $header_4_5_border = ( ( 'v4' === $header_layout || 'v5' === $header_layout ) && 1 === Fusion_Color::new_color( Fusion_Sanitize::color( Avada()->settings->get( 'header_bg_color' ) ) )->alpha ); if ( 'Top' !== $header_position || $header_2_3_border || $header_4_5_border ) { $svg_border = 'stroke="' . $svg_border_color . '" stroke-width="1"'; } if ( 'Left' === $header_position ) { $svg = ' '; } elseif ( 'Right' === $header_position ) { $svg = ' '; } elseif ( 'Top' === $header_position ) { $svg = ' '; } // Add svg markup for dropdown. if ( $has_children ) { $svg_bg = 'fill="' . Fusion_Sanitize::color( Avada()->settings->get( 'menu_sub_bg_color' ) ) . '"'; if ( 'Top' === $header_position ) { $dropdownsvg = ' '; } elseif ( 'Left' === $header_position ) { $dropdownsvg = ' '; } elseif ( 'Right' === $header_position ) { $dropdownsvg = ' '; } $svg = $svg . $dropdownsvg; } } return $title . $svg; } } } // End if(). /* Omit closing PHP tag to avoid "Headers already sent" issues. */