| @@ -1,94 +1,34 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Tutor base class | |
| 4 | - * | |
| 5 | - * @package Tutor\Base | |
| 6 | - * @author Themeum <support@themeum.com> | |
| 7 | - * @link https://themeum.com | |
| 8 | - * @since 1.0.0 | |
| 3 | + * Created by PhpStorm. | |
| 4 | + * User: themeum | |
| 5 | + * Date: 17/9/18 | |
| 6 | + * Time: 1:33 PM | |
| 9 | 7 | */ |
| 10 | 8 | |
| 11 | 9 | namespace TUTOR; |
| 12 | 10 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) | |
| 14 | 12 | exit; |
| 15 | -} | |
| 16 | -/** | |
| 17 | - * Tutor base class | |
| 18 | - * | |
| 19 | - * @since 1.0.0 | |
| 20 | - */ | |
| 13 | + | |
| 21 | 14 | class Tutor_Base { |
| 22 | 15 | |
| 23 | - /** | |
| 24 | - * Course post type | |
| 25 | - * | |
| 26 | - * @since 1.0.0 | |
| 27 | - * | |
| 28 | - * @var string | |
| 29 | - */ | |
| 30 | 16 | public $course_post_type; |
| 31 | - | |
| 32 | - /** | |
| 33 | - * Lesson post type | |
| 34 | - * | |
| 35 | - * @since 1.0.0 | |
| 36 | - * | |
| 37 | - * @var string | |
| 38 | - */ | |
| 39 | 17 | public $lesson_post_type; |
| 40 | 18 | |
| 41 | - /** | |
| 42 | - * Lesson permalink | |
| 43 | - * | |
| 44 | - * @since 1.0.0 | |
| 45 | - * | |
| 46 | - * @var string | |
| 47 | - */ | |
| 48 | 19 | public $lesson_base_permalink; |
| 49 | 20 | |
| 50 | - /** | |
| 51 | - * Course base permalink | |
| 52 | - * | |
| 53 | - * @since 2.5.0 | |
| 54 | - * | |
| 55 | - * @var string | |
| 56 | - */ | |
| 57 | - public $course_base_permalink; | |
| 58 | - | |
| 59 | - /** | |
| 60 | - * Quiz permalink | |
| 61 | - * | |
| 62 | - * @since 2.6.0 | |
| 63 | - * | |
| 64 | - * @var string | |
| 65 | - */ | |
| 66 | - public $quiz_base_permalink; | |
| 67 | - | |
| 68 | - /** | |
| 69 | - * Assignment permalink | |
| 70 | - * | |
| 71 | - * @since 2.6.0 | |
| 72 | - * | |
| 73 | - * @var string | |
| 74 | - */ | |
| 75 | - public $assignment_base_permalink; | |
| 76 | - | |
| 77 | - /** | |
| 78 | - * Register hooks | |
| 79 | - * | |
| 80 | - * @since 1.0.0 | |
| 81 | - */ | |
| 82 | 21 | public function __construct() { |
| 83 | 22 | |
| 84 | 23 | $this->course_post_type = tutor()->course_post_type; |
| 85 | 24 | $this->lesson_post_type = tutor()->lesson_post_type; |
| 86 | 25 | |
| 87 | - $this->course_base_permalink = tutor_utils()->get_option( 'course_permalink_base', 'courses' ); | |
| 88 | - $this->lesson_base_permalink = tutor_utils()->get_option( 'lesson_permalink_base', 'lessons' ); | |
| 89 | - $this->quiz_base_permalink = tutor_utils()->get_option( 'quiz_permalink_base', 'quizzes' ); | |
| 90 | - $this->assignment_base_permalink = tutor_utils()->get_option( 'assignment_permalink_base', 'assignments' ); | |
| 26 | + //Lesson Permalink | |
| 27 | + $this->lesson_base_permalink = tutor_utils()->get_option('lesson_permalink_base'); | |
| 28 | + if ( ! $this->lesson_base_permalink){ | |
| 29 | + $this->lesson_base_permalink = $this->lesson_post_type; | |
| 30 | + } | |
| 91 | 31 | |
| 92 | 32 | } |
| 93 | 33 | |
| 94 | -} | |
| 34 | +} | |