Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Nav_Menus::get_nav_items()

Retrieve a filtered array of custom LifterLMS nav menu items.


Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.nav.menus.php

			}

			$items[ $i ] = $is_object ? $data : (array) $data;
		}

		return $items;
	}

	/**
	 * Retrieve a filtered array of custom LifterLMS nav menu items.
	 *
	 * @since 3.14.7
	 * @since 3.37.12 Fixed possible access to undefined index.
	 *                Excluded endpoints with an empty url.
	 *
	 * @return array
	 */
	private function get_nav_items() {

		$items = array();

		foreach ( LLMS_Student_Dashboard::get_tabs() as $id => $data ) {

			if ( ! empty( $data['nav_item'] ) ) {

				$url = ! empty( $data['endpoint'] ) ? llms_get_endpoint_url( $data['endpoint'], '', llms_get_page_url( 'myaccount' ) ) : '';

				// No URL no nav item.
				if ( empty( $url ) ) {
					if ( empty( $data['url'] ) ) {
						continue;
					} else {
						$url = $data['url'];
					}
				}

				$title = empty( $data['title'] ) ? '' : $data['title'];

				$items[ $id ] = array(
					'url'   => $url,
					'label' => $title,
					'title' => $title,
				);

			}
		}

		$items['signin']  = array(
			'url'   => '#llms-signin',
			'label' => __( 'Sign In', 'lifterlms' ),
			'title' => __( 'Sign In', 'lifterlms' ),


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.12 Fixed possible access to undefined index. Excluded endpoints with an empty url.
3.14.7 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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