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
版权声明:本文标题:posts - How to fetch courses in all languages in WordPress? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742123940a2421850.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论