LLMS_Shortcode_Courses::get_wp_query()

Retrieve a WP_Query based on all submitted parameters


Return Return

(WP_Query)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcode.courses.php

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
protected function get_wp_query() {
 
    $args = array(
        'paged'          => is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ),
        'post__in'       => $this->get_post__in(),
        'post_type'      => 'course',
        'post_status'    => $this->get_attribute( 'post_status' ),
        'tax_query'      => $this->get_tax_query(), // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query
        'posts_per_page' => $this->get_attribute( 'posts_per_page' ),
        'order'          => $this->get_attribute( 'order' ),
        'orderby'        => $this->get_attribute( 'orderby' ),
    );
 
    return new WP_Query( $args );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
4.12.0 Handle pagination when the shortcode is used on the static front page.
3.31.0 Changed access from private to protected.
3.14.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.