LLMS_Shortcode_Courses::get_wp_query()
Retrieve a WP_Query based on all submitted parameters
Return Return
(WP_Query)
Source Source
File: includes/shortcodes/class.llms.shortcode.courses.php
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 );
}
Expand full source code Collapse full source code View on GitHub
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. |