LearnPress – WordPress LMS Plugin - Version 2.2

Version Description

  • Compatible with WordPress 4.9.4
  • Fixed "Finish Course" button not show in can retake course
Download this release

Release Info

Developer leehld
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 2.2
Comparing to
See all releases

Code changes from version 2.1.9.9 to 2.2

inc/lp-constants.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
  $upload_dir = wp_upload_dir();
6
  // version
7
- define( 'LEARNPRESS_VERSION', '2.1.9.8' );
8
 
9
  define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
10
 
4
  */
5
  $upload_dir = wp_upload_dir();
6
  // version
7
+ define( 'LEARNPRESS_VERSION', '2.2' );
8
 
9
  define( 'LP_WP_CONTENT', basename( WP_CONTENT_DIR ) );
10
 
learnpress.php CHANGED
@@ -4,10 +4,10 @@ Plugin Name: LearnPress
4
  Plugin URI: http://thimpress.com/learnpress
5
  Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  Author: ThimPress
7
- Version: 2.1.9.9
8
  Author URI: http://thimpress.com
9
  Requires at least: 3.8
10
- Tested up to: 4.9.3
11
 
12
  Text Domain: learnpress
13
  Domain Path: /languages/
4
  Plugin URI: http://thimpress.com/learnpress
5
  Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
6
  Author: ThimPress
7
+ Version: 2.2
8
  Author URI: http://thimpress.com
9
  Requires at least: 3.8
10
+ Tested up to: 4.9.4
11
 
12
  Text Domain: learnpress
13
  Domain Path: /languages/
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: thimpress, tunnhn, phonglq.foobla, thongta, kendy73, leehld
3
  Donate link:
4
  Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
5
  Requires at least: 3.8
6
- Tested up to: 4.9.3
7
- Stable tag: 2.1.9.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -199,6 +199,10 @@ https://www.transifex.com/projects/p/learnpress/
199
 
200
  == Changelog ==
201
 
 
 
 
 
202
  = 2.1.9.9 =
203
  + Compatible with WordPress 4.9.3
204
  + Fixed warnings at the Edit Quiz page
3
  Donate link:
4
  Tags: WordPress LMS, LMS, eLearning, e-Learning, Learning Management System, LMS WordPress, Course, Courses, Quiz, Quizzes, Training, Guru, Sell Courses
5
  Requires at least: 3.8
6
+ Tested up to: 4.9.4
7
+ Stable tag: 2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
199
 
200
  == Changelog ==
201
 
202
+ = 2.2 =
203
+ + Compatible with WordPress 4.9.4
204
+ + Fixed "Finish Course" button not show in can retake course
205
+
206
  = 2.1.9.9 =
207
  + Compatible with WordPress 4.9.3
208
  + Fixed warnings at the Edit Quiz page
templates/single-course/buttons.php CHANGED
@@ -30,8 +30,6 @@ $notice_enough_student = apply_filters( 'learn_press_course enough students_noti
30
  $course_status = $lp_user->get_course_status( $course->id );
31
  $can_purchase = $lp_user->can_purchase_course( $course->id );
32
  $can_enroll = $lp_user->can( 'enroll-course', $course->id );
33
- $can_retake = $lp_user->can_retake_course( $course->id, true );
34
-
35
 
36
  if ( $can_purchase ) {
37
  # todo dispay purchase button
@@ -80,7 +78,8 @@ $notice_enough_student = apply_filters( 'learn_press_course enough students_noti
80
  # -------------------------------
81
  # Finished Course
82
  # -------------------------------
83
- if ( $count = $user->can( 'retake-course', $course->id ) ): ?>
 
84
  <button
85
  class="button button-retake-course"
86
  data-course_id="<?php echo esc_attr( $course->id ); ?>"
@@ -88,6 +87,7 @@ $notice_enough_student = apply_filters( 'learn_press_course enough students_noti
88
  <?php echo esc_html( sprintf( __( 'Retake course (+%d)', 'learnpress' ), $count ) ); ?>
89
  </button>
90
  <?php
 
91
  # -------------------------------
92
  # Enrolled Course
93
  # -------------------------------
30
  $course_status = $lp_user->get_course_status( $course->id );
31
  $can_purchase = $lp_user->can_purchase_course( $course->id );
32
  $can_enroll = $lp_user->can( 'enroll-course', $course->id );
 
 
33
 
34
  if ( $can_purchase ) {
35
  # todo dispay purchase button
78
  # -------------------------------
79
  # Finished Course
80
  # -------------------------------
81
+ if ( $user->has( 'finished-course', $course->id ) ):
82
+ if ( $count = $user->can( 'retake-course', $course->id ) ): ?>
83
  <button
84
  class="button button-retake-course"
85
  data-course_id="<?php echo esc_attr( $course->id ); ?>"
87
  <?php echo esc_html( sprintf( __( 'Retake course (+%d)', 'learnpress' ), $count ) ); ?>
88
  </button>
89
  <?php
90
+ endif;
91
  # -------------------------------
92
  # Enrolled Course
93
  # -------------------------------