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
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | 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. |