admin管理员组

文章数量:1323723

I have a query which fetches English courses only. How can I fetch all the languages courses? I am using WooCommrce with LearnDash.

public static function list_courses() {
        global $post;
        $postid = $post->ID;
        query_posts( array( 'post_type' => 'sfwd-courses', 'posts_per_page' => - 1 ) );
        $courses = array();
        while ( have_posts() ) {
            the_post();
            $courses[ get_the_ID() ] = get_the_title();
        }
        wp_reset_query();
        $post = get_post( $postid );

        return $courses;
}

本文标签: postsHow to fetch courses in all languages in WordPress