Astra_Ext_Nav_Menu_Loader::get_cached_nav_menu_items()

Returns cached navigation menu items.


Description


Return

(array)


Source

File: addons/nav-menu/classes/class-astra-ext-nav-menu-loader.php

		protected function get_cached_nav_menu_items() {

			$nav_items = get_transient( self::NAV_MENU_TRANSIENT_KEY );

			if ( ! $nav_items ) {
				$nav_items = array();

				$menu_locations = get_nav_menu_locations();

				foreach ( $menu_locations as $menu_id ) {
					$_nav_items = wp_get_nav_menu_items( $menu_id );

					if ( $_nav_items ) {
						$nav_items[ $menu_id ] = $_nav_items;
					}
				}

				set_transient( self::NAV_MENU_TRANSIENT_KEY, $nav_items, WEEK_IN_SECONDS );
			}

			return $nav_items;
		}

Changelog

Changelog
Version Description
4.6.2 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.