'page', 'post__in' => ( array ) $page_ids, 'posts_per_page' => 4, 'orderby' => 'post__in', ); break; case 'trip': if ( ! class_exists( 'WP_Travel' ) ) return; $page_ids = array(); for ( $i = 1; $i <= 4; $i++ ) { if ( ! empty( $options['featured_content_trip_' . $i] ) ) $page_ids[] = $options['featured_content_trip_' . $i]; } $args = array( 'post_type' => 'itineraries', 'post__in' => ( array ) $page_ids, 'posts_per_page' => 4, 'orderby' => 'post__in', ); break; default: break; } // Run The Loop. $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); $page_post['id'] = get_the_id(); $page_post['title'] = get_the_title(); $page_post['url'] = get_the_permalink(); $page_post['image'] = has_post_thumbnail() ? get_the_post_thumbnail_url( get_the_id(), 'post-thumbnail' ) : get_template_directory_uri() . '/assets/uploads/no-featured-image-590x650.jpg'; // Push to the main array. array_push( $content, $page_post ); endwhile; endif; wp_reset_postdata(); if ( ! empty( $content ) ) { $input = $content; } return $input; } endif; // destination section content details. add_filter( 'travel_master_filter_featured_section_details', 'travel_master_get_featured_section_details' ); if ( ! function_exists( 'travel_master_render_featured_section' ) ) : /** * Start destination section * * @return string destination content * @since Travel Master 1.0.0 * */ function travel_master_render_featured_section( $content_details = array() ) { $options = travel_master_get_theme_options(); $featured_content_type = $options['featured_content_type']; if ( empty( $content_details ) ) { return; } ?>