| @@ -1,32 +1,74 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. | |
| 4 | - * User: mhshohel | |
| 5 | - * Date: 17/9/18 | |
| 6 | - * Time: 1:33 PM | |
| 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 | |
| 7 | 9 | */ |
| 8 | 10 | |
| 9 | 11 | namespace TUTOR; |
| 10 | 12 | |
| 11 | - | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; | |
| 15 | +} | |
| 16 | +/** | |
| 17 | + * Tutor base class | |
| 18 | + * | |
| 19 | + * @since 1.0.0 | |
| 20 | + */ | |
| 12 | 21 | class Tutor_Base { |
| 13 | 22 | |
| 23 | + /** | |
| 24 | + * Course post type | |
| 25 | + * | |
| 26 | + * @since 1.0.0 | |
| 27 | + * | |
| 28 | + * @var string | |
| 29 | + */ | |
| 14 | 30 | public $course_post_type; |
| 31 | + | |
| 32 | + /** | |
| 33 | + * Lesson post type | |
| 34 | + * | |
| 35 | + * @since 1.0.0 | |
| 36 | + * | |
| 37 | + * @var string | |
| 38 | + */ | |
| 15 | 39 | public $lesson_post_type; |
| 16 | 40 | |
| 41 | + /** | |
| 42 | + * Lesson permalink | |
| 43 | + * | |
| 44 | + * @since 1.0.0 | |
| 45 | + * | |
| 46 | + * @var string | |
| 47 | + */ | |
| 17 | 48 | public $lesson_base_permalink; |
| 18 | 49 | |
| 50 | + /** | |
| 51 | + * Course base permalink | |
| 52 | + * | |
| 53 | + * @since 2.5.0 | |
| 54 | + * | |
| 55 | + * @var string | |
| 56 | + */ | |
| 57 | + public $course_base_permalink; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * Register hooks | |
| 61 | + * | |
| 62 | + * @since 1.0.0 | |
| 63 | + */ | |
| 19 | 64 | public function __construct() { |
| 20 | 65 | |
| 21 | 66 | $this->course_post_type = tutor()->course_post_type; |
| 22 | 67 | $this->lesson_post_type = tutor()->lesson_post_type; |
| 23 | 68 | |
| 24 | - //Lesson Permalink | |
| 25 | - $this->lesson_base_permalink = tutor_utils()->get_option('lesson_permalink_base'); | |
| 26 | - if ( ! $this->lesson_base_permalink){ | |
| 27 | - $this->lesson_base_permalink = $this->lesson_post_type; | |
| 28 | - } | |
| 69 | + $this->course_base_permalink = tutor_utils()->get_option( 'course_permalink_base', $this->course_post_type ); | |
| 70 | + $this->lesson_base_permalink = tutor_utils()->get_option( 'lesson_permalink_base', $this->lesson_post_type ); | |
| 29 | 71 | |
| 30 | 72 | } |
| 31 | 73 | |
| 32 | -} | |
| 74 | +} | |