summaryrefslogtreecommitdiff
path: root/inc/builder/type/footer/menu
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/footer/menu
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/footer/menu')
-rw-r--r--inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js1
-rw-r--r--inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js191
-rw-r--r--inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php52
-rw-r--r--inc/builder/type/footer/menu/class-astra-footer-menu-component.php114
-rw-r--r--inc/builder/type/footer/menu/dynamic-css/dynamic.css.php291
5 files changed, 649 insertions, 0 deletions
diff --git a/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js b/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js
new file mode 100644
index 0000000..b15bb4b
--- /dev/null
+++ b/inc/builder/type/footer/menu/assets/js/minified/customizer-preview.min.js
@@ -0,0 +1 @@
+!function(){var o="#astra-footer-menu",i=astraBuilderPreview.tablet_break_point||768,a=astraBuilderPreview.mobile_break_point||544;wp.customize("astra-settings[footer-menu-alignment]",function(t){t.bind(function(t){var e;""==t.desktop&&""==t.tablet&&""==t.mobile||(e="",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.desktop+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.desktop+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.tablet+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.tablet+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {',e+="align-items: "+t.mobile+";",e+="} ",e+='.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {',e+="justify-content: "+t.mobile+";",e+="} ",e+="} ",astra_add_dynamic_css("footer-menu-alignment",e))})}),astra_responsive_font_size("astra-settings[footer-menu-font-size]",o+" .menu-item > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-color-responsive]","color",o+" .menu-item > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-h-color-responsive]","color",o+" .menu-item:hover > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-a-color-responsive]","color",o+" .menu-item.current-menu-item > a"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"desktop"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"tablet"),astra_apply_responsive_background_css("astra-settings[footer-menu-bg-obj-responsive]",o,"mobile"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-h-bg-color-responsive]","background",o+" .menu-item:hover > a"),astra_color_responsive_css("astra-footer-menu-preview","astra-settings[footer-menu-a-bg-color-responsive]","background",o+" .menu-item.current-menu-item > a"),wp.customize("astra-settings[footer-main-menu-spacing]",function(t){t.bind(function(t){var e;""==t.desktop.bottom&&""==t.desktop.top&&""==t.desktop.left&&""==t.desktop.right&&""==t.tablet.bottom&&""==t.tablet.top&&""==t.tablet.left&&""==t.tablet.right&&""==t.mobile.bottom&&""==t.mobile.top&&""==t.mobile.left&&""==t.mobile.right||(e="",e+=o+" .menu-item > a {",e+="padding-left: "+t.desktop.left+t["desktop-unit"]+";",e+="padding-right: "+t.desktop.right+t["desktop-unit"]+";",e+="padding-top: "+t.desktop.top+t["desktop-unit"]+";",e+="padding-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+=o+" .menu-item > a {",e+="padding-left: "+t.tablet.left+t["tablet-unit"]+";",e+="padding-right: "+t.tablet.right+t["tablet-unit"]+";",e+="padding-top: "+t.tablet.top+t["tablet-unit"]+";",e+="padding-bottom: "+t.tablet.bottom+t["tablet-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+=o+" .menu-item > a {",e+="padding-left: "+t.mobile.left+t["mobile-unit"]+";",e+="padding-right: "+t.mobile.right+t["mobile-unit"]+";",e+="padding-top: "+t.mobile.top+t["mobile-unit"]+";",e+="padding-bottom: "+t.mobile.bottom+t["mobile-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("footer-menu-spacing",e))})}),wp.customize("astra-settings[section-footer-menu-margin]",function(t){t.bind(function(t){var e;""==t.desktop.bottom&&""==t.desktop.top&&""==t.desktop.left&&""==t.desktop.right&&""==t.tablet.bottom&&""==t.tablet.top&&""==t.tablet.left&&""==t.tablet.right&&""==t.mobile.bottom&&""==t.mobile.top&&""==t.mobile.left&&""==t.mobile.right||(e="",e+=o+" {",e+="margin-left: "+t.desktop.left+t["desktop-unit"]+";",e+="margin-right: "+t.desktop.right+t["desktop-unit"]+";",e+="margin-top: "+t.desktop.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.desktop.bottom+t["desktop-unit"]+";",e+="} ",e+="@media (max-width: "+i+"px) {",e+=o+" {",e+="margin-left: "+t.tablet.left+t["tablet-unit"]+";",e+="margin-right: "+t.tablet.right+t["tablet-unit"]+";",e+="margin-top: "+t.tablet.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.tablet.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",e+="@media (max-width: "+a+"px) {",e+=o+" {",e+="margin-left: "+t.mobile.left+t["mobile-unit"]+";",e+="margin-right: "+t.mobile.right+t["mobile-unit"]+";",e+="margin-top: "+t.mobile.top+t["desktop-unit"]+";",e+="margin-bottom: "+t.mobile.bottom+t["desktop-unit"]+";",e+="} ",e+="} ",astra_add_dynamic_css("section-footer-menu-margin",e))})}),astra_builder_visibility_css("section-footer-menu",'.footer-widget-area[data-section="section-footer-menu"]',"block")}(jQuery); \ No newline at end of file
diff --git a/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js b/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js
new file mode 100644
index 0000000..050aa76
--- /dev/null
+++ b/inc/builder/type/footer/menu/assets/js/unminified/customizer-preview.js
@@ -0,0 +1,191 @@
+/**
+ * This file adds some LIVE to the Customizer live preview. To leverage
+ * this, set your custom settings to 'postMessage' and then add your handling
+ * here. Your javascript should grab settings from customizer controls, and
+ * then make any necessary changes to the page using jQuery.
+ *
+ * @package Astra
+ * @since 3.0.0
+ */
+
+( function( $ ) {
+
+ var selector = '#astra-footer-menu';
+ var visibility_selector = '.footer-widget-area[data-section="section-footer-menu"]';
+
+ var tablet_break_point = astraBuilderPreview.tablet_break_point || 768,
+ mobile_break_point = astraBuilderPreview.mobile_break_point || 544;
+
+ wp.customize( 'astra-settings[footer-menu-alignment]', function( value ) {
+ value.bind( function( alignment ) {
+ if( alignment.desktop != '' || alignment.tablet != '' || alignment.mobile != '' ) {
+ var dynamicStyle = '';
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {';
+ dynamicStyle += 'align-items: ' + alignment['desktop'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {';
+ dynamicStyle += 'justify-content: ' + alignment['desktop'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {';
+ dynamicStyle += 'align-items: ' + alignment['tablet'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {';
+ dynamicStyle += 'justify-content: ' + alignment['tablet'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item {';
+ dynamicStyle += 'align-items: ' + alignment['mobile'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu {';
+ dynamicStyle += 'justify-content: ' + alignment['mobile'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'footer-menu-alignment', dynamicStyle );
+ }
+ } );
+ } );
+
+ /**
+ * Typography CSS.
+ */
+ astra_responsive_font_size(
+ 'astra-settings[footer-menu-font-size]',
+ selector + ' .menu-item > a'
+ );
+
+ /**
+ * Menu - Colors
+ */
+ astra_color_responsive_css(
+ 'astra-footer-menu-preview',
+ 'astra-settings[footer-menu-color-responsive]',
+ 'color',
+ selector + ' .menu-item > a'
+ );
+
+ // Menu - Hover Color
+ astra_color_responsive_css(
+ 'astra-footer-menu-preview',
+ 'astra-settings[footer-menu-h-color-responsive]',
+ 'color',
+ selector + ' .menu-item:hover > a'
+ );
+
+ // Menu - Active Color
+ astra_color_responsive_css(
+ 'astra-footer-menu-preview',
+ 'astra-settings[footer-menu-a-color-responsive]',
+ 'color',
+ selector + ' .menu-item.current-menu-item > a'
+ );
+
+ // Responsive BG styles > Footer Menu.
+ astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'desktop' );
+ astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'tablet' );
+ astra_apply_responsive_background_css( 'astra-settings[footer-menu-bg-obj-responsive]', selector, 'mobile' );
+
+ // Menu - Hover Background
+ astra_color_responsive_css(
+ 'astra-footer-menu-preview',
+ 'astra-settings[footer-menu-h-bg-color-responsive]',
+ 'background',
+ selector + ' .menu-item:hover > a'
+ );
+
+ // Menu - Active Background
+ astra_color_responsive_css(
+ 'astra-footer-menu-preview',
+ 'astra-settings[footer-menu-a-bg-color-responsive]',
+ 'background',
+ selector + ' .menu-item.current-menu-item > a'
+ );
+
+ /**
+ * Spacing CSS.
+ */
+ wp.customize( 'astra-settings[footer-main-menu-spacing]', function( value ) {
+ value.bind( function( padding ) {
+ if(
+ padding.desktop.bottom != '' || padding.desktop.top != '' || padding.desktop.left != '' || padding.desktop.right != '' ||
+ padding.tablet.bottom != '' || padding.tablet.top != '' || padding.tablet.left != '' || padding.tablet.right != '' ||
+ padding.mobile.bottom != '' || padding.mobile.top != '' || padding.mobile.left != '' || padding.mobile.right != ''
+ ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' .menu-item > a {';
+ dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';';
+ dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';';
+ dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';';
+ dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' .menu-item > a {';
+ dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';';
+ dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';';
+ dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';';
+ dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' .menu-item > a {';
+ dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';';
+ dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';';
+ dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';';
+ dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ astra_add_dynamic_css( 'footer-menu-spacing', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Margin.
+ wp.customize( 'astra-settings[section-footer-menu-margin]', function( value ) {
+ value.bind( function( margin ) {
+ if(
+ margin.desktop.bottom != '' || margin.desktop.top != '' || margin.desktop.left != '' || margin.desktop.right != '' ||
+ margin.tablet.bottom != '' || margin.tablet.top != '' || margin.tablet.left != '' || margin.tablet.right != '' ||
+ margin.mobile.bottom != '' || margin.mobile.top != '' || margin.mobile.left != '' || margin.mobile.right != ''
+ ) {
+ var dynamicStyle = '';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+
+ dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
+ dynamicStyle += selector + ' {';
+ dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';';
+ dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['desktop-unit'] + ';';
+ dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['desktop-unit'] + ';';
+ dynamicStyle += '} ';
+ dynamicStyle += '} ';
+ astra_add_dynamic_css( 'section-footer-menu-margin', dynamicStyle );
+ }
+ } );
+ } );
+
+ // Advanced Visibility CSS Generation.
+ astra_builder_visibility_css( 'section-footer-menu', visibility_selector, 'block' );
+
+} )( jQuery );
diff --git a/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php b/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php
new file mode 100644
index 0000000..c4d0355
--- /dev/null
+++ b/inc/builder/type/footer/menu/class-astra-footer-menu-component-loader.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Footer Navigation Menu Styling Loader for Astra theme.
+ *
+ * @package Astra Builder
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Footer Navigation Menu Initialization
+ *
+ * @since 3.0.0
+ */
+class Astra_Footer_Menu_Component_Loader {
+
+ /**
+ * Constructor
+ *
+ * @since 3.0.0
+ */
+ public function __construct() {
+ add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 );
+ }
+
+ /**
+ * Customizer Preview
+ *
+ * @since 3.0.0
+ */
+ public function preview_scripts() {
+ /**
+ * Load unminified if SCRIPT_DEBUG is true.
+ */
+ /* Directory and Extension */
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
+ $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
+ wp_enqueue_script( 'astra-footer-menu-customizer-preview', ASTRA_BUILDER_FOOTER_MENU_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true );
+
+ }
+}
+
+/**
+* Kicking this off by creating the object of the class.
+*/
+new Astra_Footer_Menu_Component_Loader();
diff --git a/inc/builder/type/footer/menu/class-astra-footer-menu-component.php b/inc/builder/type/footer/menu/class-astra-footer-menu-component.php
new file mode 100644
index 0000000..7a89429
--- /dev/null
+++ b/inc/builder/type/footer/menu/class-astra-footer-menu-component.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Footer Navigation Menu component.
+ *
+ * @package Astra Builder
+ * @author Brainstorm Force
+ * @copyright Copyright (c) 2020, Brainstorm Force
+ * @link https://www.brainstormforce.com
+ * @since Astra 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+define( 'ASTRA_BUILDER_FOOTER_MENU_DIR', ASTRA_THEME_DIR . 'inc/builder/type/footer/menu' );
+define( 'ASTRA_BUILDER_FOOTER_MENU_URI', ASTRA_THEME_URI . 'inc/builder/type/footer/menu' );
+
+/**
+ * Footer Navigation Menu Initial Setup
+ *
+ * @since 3.0.0
+ */
+class Astra_Footer_Menu_Component {
+
+ /**
+ * Constructor function that initializes required actions and hooks
+ */
+ public function __construct() {
+
+ // @codingStandardsIgnoreStart WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ require_once ASTRA_BUILDER_FOOTER_MENU_DIR . '/class-astra-footer-menu-component-loader.php';
+
+ // Include front end files.
+ if ( ! is_admin() ) {
+ require_once ASTRA_BUILDER_FOOTER_MENU_DIR . '/dynamic-css/dynamic.css.php';
+ }
+ // @codingStandardsIgnoreEnd WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
+ }
+
+ /**
+ * Secondary navigation markup
+ *
+ * @since 3.0.0.
+ */
+ public static function menu_markup() {
+
+ // Menu Layout.
+ $desktop_menu_layout_class = '';
+ $tablet_menu_layout_class = '';
+ $mobile_menu_layout_class = '';
+ $menu_layout = astra_get_option( 'footer-menu-layout' );
+
+ $desktop_menu_layout = ( isset( $menu_layout['desktop'] ) ) ? $menu_layout['desktop'] : '';
+ $tablet_menu_layout = ( isset( $menu_layout['tablet'] ) ) ? $menu_layout['tablet'] : '';
+ $mobile_menu_layout = ( isset( $menu_layout['mobile'] ) ) ? $menu_layout['mobile'] : '';
+
+ if ( ! empty( $desktop_menu_layout ) ) {
+ $desktop_menu_layout_class = 'astra-footer-' . esc_attr( $desktop_menu_layout ) . '-menu';
+ }
+
+ if ( ! empty( $tablet_menu_layout ) ) {
+ $tablet_menu_layout_class = 'astra-footer-tablet-' . esc_attr( $tablet_menu_layout ) . '-menu';
+ }
+
+ if ( ! empty( $mobile_menu_layout ) ) {
+ $mobile_menu_layout_class = 'astra-footer-mobile-' . esc_attr( $mobile_menu_layout ) . '-menu';
+ }
+
+ /**
+ * Filter the classes(array) for Menu (<ul>).
+ *
+ * @since 3.0.0
+ * @var Array
+ */
+ $menu_classes = apply_filters( 'astra_menu_classes', array( 'ast-nav-menu', 'ast-flex', $desktop_menu_layout_class, $tablet_menu_layout_class, $mobile_menu_layout_class ) );
+
+ $items_wrap = '<nav ';
+ $items_wrap .= astra_attr(
+ 'site-navigation',
+ array(
+ 'id' => 'site-navigation',
+ 'class' => 'ast-flex-grow-1 navigation-accessibility footer-navigation',
+ 'aria-label' => esc_attr__( 'Site Navigation', 'astra' ),
+ )
+ );
+ $items_wrap .= '>';
+ $items_wrap .= '<div class="footer-nav-wrap">';
+ $items_wrap .= '<ul id="%1$s" class="%2$s">%3$s</ul>';
+ $items_wrap .= '</div>';
+ $items_wrap .= '</nav>';
+
+ // To add default alignment for navigation which can be added through any third party plugin.
+ // Do not add any CSS from theme except header alignment.
+ if ( has_nav_menu( 'footer_menu' ) ) {
+ wp_nav_menu(
+ array(
+ 'depth' => 1,
+ 'menu_id' => 'astra-footer-menu',
+ 'menu_class' => esc_attr( implode( ' ', $menu_classes ) ),
+ 'container' => 'div',
+ 'container_class' => 'footer-bar-navigation',
+ 'items_wrap' => $items_wrap,
+ 'theme_location' => 'footer_menu',
+ )
+ );
+ }
+ }
+}
+
+/**
+ * Kicking this off by creating an object.
+ */
+new Astra_Footer_Menu_Component();
diff --git a/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php b/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php
new file mode 100644
index 0000000..1686dc8
--- /dev/null
+++ b/inc/builder/type/footer/menu/dynamic-css/dynamic.css.php
@@ -0,0 +1,291 @@
+<?php
+/**
+ * Footer Menu Colors - Dynamic CSS
+ *
+ * @package astra-builder
+ * @since 3.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Footer Menu Colors
+ */
+add_filter( 'astra_dynamic_theme_css', 'astra_hb_footer_menu_dynamic_css', 11 );
+
+/**
+ * Dynamic CSS
+ *
+ * @param string $dynamic_css Astra Dynamic CSS.
+ * @param string $dynamic_css_filtered Astra Dynamic CSS Filters.
+ * @return String Generated dynamic CSS for Footer Menu Colors.
+ *
+ * @since 3.0.0
+ */
+function astra_hb_footer_menu_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
+
+ if ( ! Astra_Builder_Helper::is_component_loaded( 'menu', 'footer' ) ) {
+ return $dynamic_css;
+ }
+
+ $_section = 'section-footer-menu';
+
+ $selector = '#astra-footer-menu';
+
+ $visibility_selector = '.footer-widget-area[data-section="section-footer-menu"]';
+
+ // Menu.
+ $menu_resp_color = astra_get_option( 'footer-menu-color-responsive' );
+ $menu_resp_bg_color = astra_get_option( 'footer-menu-bg-obj-responsive' );
+ $menu_resp_color_hover = astra_get_option( 'footer-menu-h-color-responsive' );
+ $menu_resp_bg_color_hover = astra_get_option( 'footer-menu-h-bg-color-responsive' );
+ $menu_resp_color_active = astra_get_option( 'footer-menu-a-color-responsive' );
+ $menu_resp_bg_color_active = astra_get_option( 'footer-menu-a-bg-color-responsive' );
+
+ $alignment = astra_get_option( 'footer-menu-alignment' );
+
+ $desktop_alignment = ( isset( $alignment['desktop'] ) ) ? $alignment['desktop'] : '';
+ $tablet_alignment = ( isset( $alignment['tablet'] ) ) ? $alignment['tablet'] : '';
+ $mobile_alignment = ( isset( $alignment['mobile'] ) ) ? $alignment['mobile'] : '';
+
+ $menu_resp_color_desktop = ( isset( $menu_resp_color['desktop'] ) ) ? $menu_resp_color['desktop'] : '';
+ $menu_resp_color_tablet = ( isset( $menu_resp_color['tablet'] ) ) ? $menu_resp_color['tablet'] : '';
+ $menu_resp_color_mobile = ( isset( $menu_resp_color['mobile'] ) ) ? $menu_resp_color['mobile'] : '';
+
+ $menu_resp_color_hover_desktop = ( isset( $menu_resp_color_hover['desktop'] ) ) ? $menu_resp_color_hover['desktop'] : '';
+ $menu_resp_color_hover_tablet = ( isset( $menu_resp_color_hover['tablet'] ) ) ? $menu_resp_color_hover['tablet'] : '';
+ $menu_resp_color_hover_mobile = ( isset( $menu_resp_color_hover['mobile'] ) ) ? $menu_resp_color_hover['mobile'] : '';
+
+ $menu_resp_bg_color_hover_desktop = ( isset( $menu_resp_bg_color_hover['desktop'] ) ) ? $menu_resp_bg_color_hover['desktop'] : '';
+ $menu_resp_bg_color_hover_tablet = ( isset( $menu_resp_bg_color_hover['tablet'] ) ) ? $menu_resp_bg_color_hover['tablet'] : '';
+ $menu_resp_bg_color_hover_mobile = ( isset( $menu_resp_bg_color_hover['mobile'] ) ) ? $menu_resp_bg_color_hover['mobile'] : '';
+
+ $menu_resp_color_active_desktop = ( isset( $menu_resp_color_active['desktop'] ) ) ? $menu_resp_color_active['desktop'] : '';
+ $menu_resp_color_active_tablet = ( isset( $menu_resp_color_active['tablet'] ) ) ? $menu_resp_color_active['tablet'] : '';
+ $menu_resp_color_active_mobile = ( isset( $menu_resp_color_active['mobile'] ) ) ? $menu_resp_color_active['mobile'] : '';
+
+ $menu_resp_bg_color_active_desktop = ( isset( $menu_resp_bg_color_active['desktop'] ) ) ? $menu_resp_bg_color_active['desktop'] : '';
+ $menu_resp_bg_color_active_tablet = ( isset( $menu_resp_bg_color_active['tablet'] ) ) ? $menu_resp_bg_color_active['tablet'] : '';
+ $menu_resp_bg_color_active_mobile = ( isset( $menu_resp_bg_color_active['mobile'] ) ) ? $menu_resp_bg_color_active['mobile'] : '';
+
+ // Typography.
+ $menu_font_size = astra_get_option( 'footer-menu-font-size' );
+
+ $menu_font_size_desktop = ( isset( $menu_font_size['desktop'] ) ) ? $menu_font_size['desktop'] : '';
+ $menu_font_size_tablet = ( isset( $menu_font_size['tablet'] ) ) ? $menu_font_size['tablet'] : '';
+ $menu_font_size_mobile = ( isset( $menu_font_size['mobile'] ) ) ? $menu_font_size['mobile'] : '';
+ $menu_font_size_desktop_unit = ( isset( $menu_font_size['desktop-unit'] ) ) ? $menu_font_size['desktop-unit'] : '';
+ $menu_font_size_tablet_unit = ( isset( $menu_font_size['tablet-unit'] ) ) ? $menu_font_size['tablet-unit'] : '';
+ $menu_font_size_mobile_unit = ( isset( $menu_font_size['mobile-unit'] ) ) ? $menu_font_size['mobile-unit'] : '';
+
+ // Menu Spacing.
+ $menu_spacing = astra_get_option( 'footer-main-menu-spacing' );
+
+ // - Desktop.
+ $menu_desktop_spacing_top = ( isset( $menu_spacing['desktop']['top'] ) && ! empty( $menu_spacing['desktop']['top'] ) ) ? $menu_spacing['desktop']['top'] : '';
+
+ $menu_desktop_spacing_bottom = ( isset( $menu_spacing['desktop']['bottom'] ) && ! empty( $menu_spacing['desktop']['bottom'] ) ) ? $menu_spacing['desktop']['bottom'] : '';
+
+ $menu_desktop_spacing_right = ( isset( $menu_spacing['desktop']['right'] ) && ! empty( $menu_spacing['desktop']['right'] ) ) ? $menu_spacing['desktop']['right'] : '';
+
+ $menu_desktop_spacing_left = ( isset( $menu_spacing['desktop']['left'] ) && ! empty( $menu_spacing['desktop']['left'] ) ) ? $menu_spacing['desktop']['left'] : '';
+
+ $menu_desktop_spacing_unit = ( isset( $menu_spacing['desktop-unit'] ) && ! empty( $menu_spacing['desktop-unit'] ) ) ? $menu_spacing['desktop-unit'] : '';
+
+ // - Tablet.
+ $menu_tablet_spacing_top = ( isset( $menu_spacing['tablet']['top'] ) && ! empty( $menu_spacing['tablet']['top'] ) ) ? $menu_spacing['tablet']['top'] : '';
+
+ $menu_tablet_spacing_bottom = ( isset( $menu_spacing['tablet']['bottom'] ) && ! empty( $menu_spacing['tablet']['bottom'] ) ) ? $menu_spacing['tablet']['bottom'] : '';
+
+ $menu_tablet_spacing_right = ( isset( $menu_spacing['tablet']['right'] ) && ! empty( $menu_spacing['tablet']['right'] ) ) ? $menu_spacing['tablet']['right'] : '';
+
+ $menu_tablet_spacing_left = ( isset( $menu_spacing['tablet']['left'] ) && ! empty( $menu_spacing['tablet']['left'] ) ) ? $menu_spacing['tablet']['left'] : '';
+
+ $menu_tablet_spacing_unit = ( isset( $menu_spacing['tablet-unit'] ) && ! empty( $menu_spacing['tablet-unit'] ) ) ? $menu_spacing['tablet-unit'] : '';
+
+ // - Mobile.
+ $menu_mobile_spacing_top = ( isset( $menu_spacing['mobile']['top'] ) && ! empty( $menu_spacing['mobile']['top'] ) ) ? $menu_spacing['mobile']['top'] : '';
+
+ $menu_mobile_spacing_bottom = ( isset( $menu_spacing['mobile']['bottom'] ) && ! empty( $menu_spacing['mobile']['bottom'] ) ) ? $menu_spacing['mobile']['bottom'] : '';
+
+ $menu_mobile_spacing_right = ( isset( $menu_spacing['mobile']['right'] ) && ! empty( $menu_spacing['mobile']['right'] ) ) ? $menu_spacing['mobile']['right'] : '';
+
+ $menu_mobile_spacing_left = ( isset( $menu_spacing['mobile']['left'] ) && ! empty( $menu_spacing['mobile']['left'] ) ) ? $menu_spacing['mobile']['left'] : '';
+
+ $menu_mobile_spacing_unit = ( isset( $menu_spacing['mobile-unit'] ) && ! empty( $menu_spacing['mobile-unit'] ) ) ? $menu_spacing['mobile-unit'] : '';
+
+ $margin = astra_get_option( $_section . '-margin' );
+
+ $arr_footer_ul_desktop = array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ),
+ );
+
+ $arr_footer_ul_desktop = array_merge( $arr_footer_ul_desktop, astra_get_responsive_background_obj( $menu_resp_bg_color, 'desktop' ) );
+
+ $css_output_desktop = array(
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-horizontal-menu' => array(
+ 'justify-content' => $desktop_alignment,
+ ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-vertical-menu .menu-item' => array(
+ 'align-items' => $desktop_alignment,
+ ),
+ $selector . ' .menu-item > a' => array(
+ 'color' => $menu_resp_color_desktop,
+ 'font-size' => astra_get_font_css_value( $menu_font_size_desktop, $menu_font_size_desktop_unit ),
+ 'padding-top' => astra_get_css_value( $menu_desktop_spacing_top, $menu_desktop_spacing_unit ),
+ 'padding-bottom' => astra_get_css_value( $menu_desktop_spacing_bottom, $menu_desktop_spacing_unit ),
+ 'padding-left' => astra_get_css_value( $menu_desktop_spacing_left, $menu_desktop_spacing_unit ),
+ 'padding-right' => astra_get_css_value( $menu_desktop_spacing_right, $menu_desktop_spacing_unit ),
+ ),
+ $selector . ' .menu-item:hover > a' => array(
+ 'color' => $menu_resp_color_hover_desktop,
+ 'background' => $menu_resp_bg_color_hover_desktop,
+ ),
+ $selector . ' .menu-item.current-menu-item > a' => array(
+ 'color' => $menu_resp_color_active_desktop,
+ 'background' => $menu_resp_bg_color_active_desktop,
+ ),
+ $selector => $arr_footer_ul_desktop,
+ );
+
+ $arr_footer_ul_tablet = array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ),
+ );
+
+ $arr_footer_ul_tablet = array_merge( $arr_footer_ul_tablet, astra_get_responsive_background_obj( $menu_resp_bg_color, 'tablet' ) );
+
+ $css_output_tablet = array(
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-horizontal-menu' => array(
+ 'justify-content' => $tablet_alignment,
+ ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-vertical-menu' => array(
+ 'display' => 'grid',
+ ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-tablet-vertical-menu .menu-item' => array(
+ 'align-items' => $tablet_alignment,
+ ),
+ $selector . ' .menu-item > a' => array(
+ 'color' => $menu_resp_color_tablet,
+ 'font-size' => astra_get_font_css_value( $menu_font_size_tablet, $menu_font_size_tablet_unit ),
+ 'padding-top' => astra_get_css_value( $menu_tablet_spacing_top, $menu_tablet_spacing_unit ),
+ 'padding-bottom' => astra_get_css_value( $menu_tablet_spacing_bottom, $menu_tablet_spacing_unit ),
+ 'padding-left' => astra_get_css_value( $menu_tablet_spacing_left, $menu_tablet_spacing_unit ),
+ 'padding-right' => astra_get_css_value( $menu_tablet_spacing_right, $menu_tablet_spacing_unit ),
+ ),
+ $selector . ' .menu-item:hover > a' => array(
+ 'color' => $menu_resp_color_hover_tablet,
+ 'background' => $menu_resp_bg_color_hover_tablet,
+ ),
+ $selector . ' .menu-item.current-menu-item > a' => array(
+ 'color' => $menu_resp_color_active_tablet,
+ 'background' => $menu_resp_bg_color_active_tablet,
+ ),
+ $selector => $arr_footer_ul_tablet,
+ );
+
+ $arr_footer_ul_mobile = array(
+ // Margin CSS.
+ 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ),
+ 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ),
+ 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ),
+ 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ),
+ );
+
+ $arr_footer_ul_mobile = array_merge( $arr_footer_ul_mobile, astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ) );
+
+ $css_output_mobile = array(
+ $selector => astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-horizontal-menu' => array(
+ 'justify-content' => $mobile_alignment,
+ ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-vertical-menu' => array(
+ 'display' => 'grid',
+ ),
+ '.footer-widget-area[data-section="section-footer-menu"] .astra-footer-mobile-vertical-menu .menu-item' => array(
+ 'align-items' => $mobile_alignment,
+ ),
+ $selector . ' .menu-item > a' => array(
+ 'color' => $menu_resp_color_mobile,
+ 'font-size' => astra_get_font_css_value( $menu_font_size_mobile, $menu_font_size_mobile_unit ),
+ 'padding-top' => astra_get_css_value( $menu_mobile_spacing_top, $menu_mobile_spacing_unit ),
+ 'padding-bottom' => astra_get_css_value( $menu_mobile_spacing_bottom, $menu_mobile_spacing_unit ),
+ 'padding-left' => astra_get_css_value( $menu_mobile_spacing_left, $menu_mobile_spacing_unit ),
+ 'padding-right' => astra_get_css_value( $menu_mobile_spacing_right, $menu_mobile_spacing_unit ),
+ ),
+ $selector . ' .menu-item:hover > a' => array(
+ 'color' => $menu_resp_color_hover_mobile,
+ 'background' => $menu_resp_bg_color_hover_mobile,
+ ),
+ $selector . ' .menu-item.current-menu-item > a' => array(
+ 'color' => $menu_resp_color_active_mobile,
+ 'background' => $menu_resp_bg_color_active_mobile,
+ ),
+ $selector => $arr_footer_ul_mobile,
+ );
+
+ /* Parse CSS from array() */
+ $css_output = footer_menu_static_css();
+ $css_output .= astra_parse_css( $css_output_desktop );
+ $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() );
+ $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() );
+
+ $dynamic_css .= $css_output;
+
+ $dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $visibility_selector, 'block' );
+
+ return $dynamic_css;
+}
+
+/**
+ * Footer menu static CSS
+ *
+ * @since 3.5.0
+ * @return string
+ */
+function footer_menu_static_css() {
+ $footer_menu_css = '
+ .footer-nav-wrap .astra-footer-vertical-menu {
+ display: grid;
+ }
+ @media (min-width: 769px) {
+ .footer-nav-wrap .astra-footer-horizontal-menu li {
+ margin: 0;
+ }
+ .footer-nav-wrap .astra-footer-horizontal-menu a {
+ padding: 0 0.5em;
+ }
+ }';
+
+ if ( is_rtl() ) {
+ $footer_menu_css .= '
+ @media (min-width: 769px) {
+ .footer-nav-wrap .astra-footer-horizontal-menu li:first-child a {
+ padding-right: 0;
+ }
+ .footer-nav-wrap .astra-footer-horizontal-menu li:last-child a {
+ padding-left: 0;
+ }
+ }';
+ } else {
+ $footer_menu_css .= '
+ @media (min-width: 769px) {
+ .footer-nav-wrap .astra-footer-horizontal-menu li:first-child a {
+ padding-left: 0;
+ }
+ .footer-nav-wrap .astra-footer-horizontal-menu li:last-child a {
+ padding-right: 0;
+ }
+ }';
+ }
+ return Astra_Enqueue_Scripts::trim_css( $footer_menu_css );
+}