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

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;
    }
 
}


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.