From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- inc/admin-functions.php | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 inc/admin-functions.php (limited to 'inc/admin-functions.php') diff --git a/inc/admin-functions.php b/inc/admin-functions.php new file mode 100644 index 0000000..b9d5b1e --- /dev/null +++ b/inc/admin-functions.php @@ -0,0 +1,85 @@ + __( 'Primary Menu', 'astra' ), + ) + ); + + if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) { + + /** + * Register the Secondary & Mobile menus. + */ + register_nav_menus( + array( + 'secondary_menu' => __( 'Secondary Menu', 'astra' ), + 'mobile_menu' => __( 'Off-Canvas Menu', 'astra' ), + ) + ); + + + $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu; + + for ( $index = 3; $index <= $component_limit; $index++ ) { + + if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'menu-' . $index ) ) { + continue; + } + + register_nav_menus( + array( + 'menu_' . $index => __( 'Menu ', 'astra' ) . $index, + ) + ); + } + + /** + * Register the Account menus. + */ + register_nav_menus( + array( + 'loggedin_account_menu' => __( 'Logged In Account Menu', 'astra' ), + ) + ); + + } + + /** + * Footer Menus + */ + register_nav_menus( + array( + 'footer_menu' => __( 'Footer Menu', 'astra' ), + ) + ); + + } +} + +add_action( 'init', 'astra_register_menu_locations' ); -- cgit v1.2.3-70-g09d2