public/wordpress/wp-content/plugins/wp-courseware/includes/functions/students.php
/**
 * Get Student Account Menu Items Classes.
 *
 * @since 4.3.0
 *
 * @param string $endpoint The account endpoint.
 *
 * @return string The account endpoint classes.
 */
Get Student Account Menu Items Classes.

@param string $endpoint The account endpoint.

@return string The account endpoint classes.
Get Student Account Menu Items Classes . @param string $endpoint The account endpoint . @return string The account endpoint classes .
function wpcw_get_student_account_menu_item_classes( $endpoint ) {
	global $wp;
	$classes = array(
		'wpcw-student-account-navigation-link',
		'wpcw-student-account-navigation-link-' . $endpoint,
	);
	$current = isset( $wp->query_vars[ $endpoint ] );
	if ( 'dashboard' === $endpoint && ( isset( $wp->query_vars['page'] ) || empty( $wp->query_vars ) ) ) {
		$current = true; 
	}
	if ( 'orders' === $endpoint && ( isset( $wp->query_vars['view-order'] ) ) ) {
		$current = true;
	}
	if ( 'subscriptions' === $endpoint && ( isset( $wp->query_vars['view-subscription'] ) ) ) {
		$current = true;
	}
	if ( $current ) {
		$classes[] = 'is-active';
	}
	$classes = apply_filters( 'wpcw_student_account_menu_item_classes', $classes, $endpoint );
	return implode( ' ', array_map( 'sanitize_html_class', $classes ) );
}
function wpcw_get_student_account_menu_item_classes ( $ endpoint ) { global $ wp ; $ classes = array ( 'wpcw-student-account-navigation-link' , 'wpcw-student-account-navigation-link-' . $ endpoint , ) ; $ current = isset ( $ wp -> query_vars [ $ endpoint ] ) ; if ( 'dashboard' === $ endpoint && ( isset ( $ wp -> query_vars [ 'page' ] ) || empty ( $ wp -> query_vars ) ) ) { $ current = true ; } if ( 'orders' === $ endpoint && ( isset ( $ wp -> query_vars [ 'view-order' ] ) ) ) { $ current = true ; } if ( 'subscriptions' === $ endpoint && ( isset ( $ wp -> query_vars [ 'view-subscription' ] ) ) ) { $ current = true ; } if ( $ current ) { $ classes [ ] = 'is-active' ; } $ classes = apply_filters ( 'wpcw_student_account_menu_item_classes' , $ classes , $ endpoint ) ; return implode ( ' ' , array_map ( 'sanitize_html_class' , $ classes ) ) ; }
Get Student Account Menu Items Classes.
Get Student Account Menu Items Classes .
// Set current item class. // Dashboard is not an endpoint, so needs a custom check. /**
	 * Filter: Student Account Menu Item Classes.
	 *
	 * @since 4.3.0
	 */