• Resolved Krishna

    (@kingswp)


    I would like to create a WP Query object (similar to https://developers.elementor.com/docs/hooks/custom-query-filter/) for querying all Tutor LMS courses belonging to a specific course category. Please let me know which filter should be used to specify course category.

    function my_query_by_post_types( $query ) {
       $query->set( 'post_type', [ 'courses'] );
       $query->set( 'post_status', [ 'publish'] );
    
       //TODO: Set Course category to 'Personal Mastery'.
    }
    add_action( 'elementor/query/{$query_id}', 'my_query_by_post_types' );
Viewing 1 replies (of 1 total)
  • Dear @kingswp

    We are using this function to get course categories tutils()->get_course_categories_term();

    So you can create a custom filter with this functions.

    Have a good day.

Viewing 1 replies (of 1 total)

The topic ‘Query object for a specific Course Category’ is closed to new replies.