Querying a list of LearnDash lessons

Question

I’m trying to query a list of LearnDash lessons based on the course ID but having some trouble. I’m using Elementor and the ‘query filter’ option where by I include an ID (just name) of the filter in my functions file. I thought I had it working but apparently it is not. Any help would be great.

  add_action( 'elementor/query/lessons', function( $query ) {


  $query->set( 'post_type', 'sfwd-lessons' );
  $query->set( 'order', 'ASC' );
  $query->set( 'meta_query', array(
                                   array(
                                         'key' => 'lesson_id',
                                      
                                         'value' => '4415',
                                         'compare' => '=',
                                        )
                                   )
                              );

} );
0
Robert 2 months 0 Answers 10 views 0

Leave an answer