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'
Return Return
(mixed)
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;
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |