dozent_course_sort_by( null $sort = null )


Parameters

$sort

(null) (Optional) if pass any sort key, it will return related sort label | name

Default value: null


Return

(array|bool|mixed|void) Return default sort by array


Source

File: includes/core-functions.php

	function dozent_course_sort_by( $sort = null ) {

		$default_sorting = [
			'relevance'       => __( 'Most Relevant', 'dozent' ),
			'most-reviewed'   => __( 'Most Reviewed', 'dozent' ),
			'highest-rated'   => __( 'Highest Rated', 'dozent' ),
			'newest-first'    => __( 'Release Date (newest first)', 'dozent' ),
			'oldest-first'    => __( 'Release Date (oldest first)', 'dozent' ),
			'course-title-az' => __( 'Course Title (a-z)', 'dozent' ),
			'course-title-za' => __( 'Course Title (z-a)', 'dozent' ),

			'price-low-to-high' => __( 'Lowest Price', 'dozent' ),
			'price-high-to-low' => __( 'Highest Price', 'dozent' ),
		];

		if ( $sort ) {
			return dozent_array_get( $sort, $default_sorting );
		}

		return apply_filters( 'dozent_course_sort_by', $default_sorting );
	}