在自定义模板(访问者的课程页面)上的课程中打印出课程列表learningdash get_course_lessons() [英] Printing out the lesson list in a course on custom template (course page for visitors) learndash get_course_lessons()

查看:69
本文介绍了在自定义模板(访问者的课程页面)上的课程中打印出课程列表learningdash get_course_lessons()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用简码打印出了课程的内容或课程列表,但是没有用

Hi I have used the shortcode to print out the course content or the list of lessons in a course but it doesnt work

我尝试使用以下方法

get_course_lessons();

get_course_lessons();

当我添加get_course_lessons()时;,它说"get_course_lessons"是未定义的,而get课程是以下文件中的公共课程wp-content/plugins/sfwd-lms/includes/classes/class-ldlms-factory-post.php

when I add get_course_lessons(); , it says that 'get_course_lessons' is undefined, and the get course lessons is a public class in the following file wp-content/plugins/sfwd-lms/includes/classes/class-ldlms-factory-post.php

如果可以的话,上面的路径是正确的方法吗?或者有更好的方法吗?

Is the above path is the right way if so how can i get it working or is there a better way to do it?

谢谢

推荐答案

您应使用 learndash_get_course_lessons_list()

learndash_get_course_lessons_list( int|WP_Post|null $course = null,  int|null $user_id = null,  array $lessons_args = array() )

将课程ID传递到$ course,它将返回该特定课程的所有课程.

Pass the course ID to $course and it will return all the lessons from that specefic course.

这篇关于在自定义模板(访问者的课程页面)上的课程中打印出课程列表learningdash get_course_lessons()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆