PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 All 140 releases
← All changes | inc/admin/views/meta-boxes/quiz/assigned.php +12 -5 4.1.7.2 → 4.4.9 View file →
@@ -1,12 +1,13 @@
1 1 <?php
2 2 /**
3 3 * Admin View: Question assigned Meta box
4 + *
5 + * @version 1.0.1
4 6 */
5 7
6 -/**
7 - * Prevent loading this file directly
8 - */
8 +use LearnPress\Models\CourseModel;
9 +
9 10 defined( 'ABSPATH' ) || exit();
10 11
11 12 global $post;
12 13 $curd = new LP_Question_CURD();
@@ -18,9 +19,15 @@
18 19 <?php $courses = learn_press_get_item_courses( $quiz->ID ); ?>
19 20
20 21 <?php if ( $courses ) : ?>
21 22 <ul class="parent-courses">
22 - <?php foreach ( $courses as $course ) : ?>
23 + <?php
24 + foreach ( $courses as $course ) :
25 + $courseModel = CourseModel::find( $course->ID, true );
26 + if ( ! $courseModel ) {
27 + continue;
28 + }
29 + ?>
23 30 <li>
24 31 <strong>
25 32 <a href="<?php echo get_edit_post_link( $course->ID ); ?>" target="_blank"><?php echo get_the_title( $course->ID ); ?></a>
26 33 </strong>
@@ -33,9 +40,9 @@
33 40 &#8212; &#8212;
34 41 <?php echo get_the_title( $quiz->ID ); ?></a>
35 42 </strong>
36 43 &#8212;
37 - <a href="<?php echo learn_press_get_course_item_permalink( $course->ID, $quiz->ID ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
44 + <a href="<?php echo $courseModel->get_item_link( $quiz->ID ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
38 45 </li>
39 46 </ul>
40 47 </li>
41 48 <?php endforeach; ?>