public/wordpress/wp-content/plugins/wp-courseware/includes/controllers/courses.php
/**
	 * Shortcode Courses Display.
	 *
	 * @since 4.3.0
	 *
	 * @param array $atts The array of shortcode attributes.
	 */
Shortcode Courses Display.

@param array $atts The array of shortcode attributes.
Shortcode Courses Display . @param array $atts The array of shortcode attributes .
public function courses_display( $atts = array() ) {
		$display_atts = array(
			'number'        => 100,
			'order'         => 'DESC',
			'orderby'       => 'date',
			'course_author' => '',
			'course_id'     => 0,
			'search'        => '',
			'show_image'    => true,
			'show_desc'     => true,
			'show_button'   => true,
		);
		$display_atts = wp_parse_args( $atts, $display_atts );
		$display_atts['show_image']  = filter_var( $display_atts['show_image'], FILTER_VALIDATE_BOOLEAN );
		$display_atts['show_desc']   = filter_var( $display_atts['show_desc'], FILTER_VALIDATE_BOOLEAN );
		$display_atts['show_button'] = filter_var( $display_atts['show_button'], FILTER_VALIDATE_BOOLEAN );
		$query_args = array(
			'number'        => ! empty( $display_atts['number'] ) ? absint( $display_atts['number'] ) : 10,
			'order'         => ! empty( $display_atts['order'] ) ? esc_attr( $display_atts['order'] ) : 'DESC',
			'orderby'       => ! empty( $display_atts['orderby'] ) ? esc_attr( $display_atts['orderby'] ) : 'date',
			'course_author' => ! empty( $display_atts['course_author'] ) ? absint( $display_atts['course_author'] ) : '',
			'course_id'     => ! empty( $display_atts['course_id'] ) ? absint( $display_atts['course_id'] ) : 0,
			'search'        => ! empty( $display_atts['search'] ) ? $display_atts['search'] : '',
		);
		$courses = $this->get_courses( $query_args );
		if ( empty( $courses ) ) {
			wpcw_print_notice( esc_html__( 'There are currently no courses available to display.', 'wp-courseware' ), 'info' );
			return;
		}
		wpcw_get_template( 'courses.php', array( 'courses' => $courses, 'atts' => $display_atts ) );
	}
public function courses_display ( $ atts = array ( ) ) { $ display_atts = array ( 'number' => 100 , 'order' => 'DESC' , 'orderby' => 'date' , 'course_author' => '' , 'course_id' => 0 , 'search' => '' , 'show_image' => true , 'show_desc' => true , 'show_button' => true , ) ; $ display_atts = wp_parse_args ( $ atts , $ display_atts ) ; $ display_atts [ 'show_image' ] = filter_var ( $ display_atts [ 'show_image' ] , FILTER_VALIDATE_BOOLEAN ) ; $ display_atts [ 'show_desc' ] = filter_var ( $ display_atts [ 'show_desc' ] , FILTER_VALIDATE_BOOLEAN ) ; $ display_atts [ 'show_button' ] = filter_var ( $ display_atts [ 'show_button' ] , FILTER_VALIDATE_BOOLEAN ) ; $ query_args = array ( 'number' => ! empty ( $ display_atts [ 'number' ] ) ? absint ( $ display_atts [ 'number' ] ) : 10 , 'order' => ! empty ( $ display_atts [ 'order' ] ) ? esc_attr ( $ display_atts [ 'order' ] ) : 'DESC' , 'orderby' => ! empty ( $ display_atts [ 'orderby' ] ) ? esc_attr ( $ display_atts [ 'orderby' ] ) : 'date' , 'course_author' => ! empty ( $ display_atts [ 'course_author' ] ) ? absint ( $ display_atts [ 'course_author' ] ) : '' , 'course_id' => ! empty ( $ display_atts [ 'course_id' ] ) ? absint ( $ display_atts [ 'course_id' ] ) : 0 , 'search' => ! empty ( $ display_atts [ 'search' ] ) ? $ display_atts [ 'search' ] : '' , ) ; $ courses = $ this -> get_courses ( $ query_args ) ; if ( empty ( $ courses ) ) { wpcw_print_notice ( esc_html__ ( 'There are currently no courses available to display.' , 'wp-courseware' ) , 'info' ) ; return ; } wpcw_get_template ( 'courses.php' , array ( 'courses' => $ courses , 'atts' => $ display_atts ) ) ; }
Shortcode Courses Display.
Shortcode Courses Display .
// Boolean values. // Query Aargs. // Get Courses.