LLMS_Student_Dashboard::get_current_tab( string $return = 'data' )

Retrieve the current tab when on the student dashboard


Parameters Parameters

$return

(string) (Optional) type of return, either "data" for an array of data or 'slug' for just the slug

Default value: 'data'


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: includes/class.llms.student.dashboard.php

	public static function get_current_tab( $return = 'data' ) {

		global $wp;

		// Set default tab.
		$current_tab = apply_filters( 'llms_student_dashboard_default_tab', 'dashboard' );

		$tabs = self::get_tabs();

		foreach ( $tabs as $var => $data ) {
			if ( isset( $wp->query_vars[ $var ] ) ) {
				$current_tab = $var;
				break;
			}
		}

		if ( 'data' === $return ) {
			return $tabs[ $current_tab ];
		} else {
			return $current_tab;
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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