PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
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 4.2.0 All 139 releases
← All changes | inc/lp-constants.php +52 -13 4.1.74.4.8 View file →
@@ -1,20 +1,29 @@
1 1 <?php
2 2 /**
3 3 * Define common constants used by LearnPress
4 4 */
5 -include_once ABSPATH . 'wp-admin/includes/plugin.php';
6 -$upload_dir = wp_upload_dir();
7 -$plugin_info = get_plugin_data( LP_PLUGIN_FILE );
5 +require_once ABSPATH . 'wp-admin/includes/plugin.php';
6 +$upload_dir = wp_upload_dir();
8 7
8 +$default_headers = array(
9 + 'Version' => 'Version',
10 + 'TextDomain' => 'Text Domain',
11 +);
12 +$plugin_info = get_file_data( LP_PLUGIN_FILE, $default_headers, 'plugin' );
13 +
9 14 // version.
10 15 define( 'LEARNPRESS_VERSION', $plugin_info['Version'] );
11 16 const LP_KEY_DB_VERSION = 'learnpress_db_version';
17 +/**
18 + * @since 4.2.6.5
19 + */
20 +define( 'LP_TEXT_DOMAIN', $plugin_info['TextDomain'] );
12 21
13 22 // Plugin paths and urls.
14 23 define( 'LP_PLUGIN_PATH', plugin_dir_path( LP_PLUGIN_FILE ) );
15 24 define( 'LP_PLUGIN_BASENAME', plugin_basename( LP_PLUGIN_FILE ) );
16 -define( 'LP_PLUGIN_FOLDER_NAME', str_replace( array( '/', basename( LP_PLUGIN_FILE ) ), '', LP_PLUGIN_BASENAME ) );
25 +define( 'LP_PLUGIN_FOLDER_NAME', dirname( LP_PLUGIN_BASENAME ) );
17 26 const LP_TEMPLATE_PATH = LP_PLUGIN_PATH . 'templates/';
18 27 define( 'LP_PLUGIN_URL', trailingslashit( plugins_url( '/', LP_PLUGIN_FILE ) ) );
19 28 const LP_JS_URL = LP_PLUGIN_URL . 'assets/js/';
20 29 const LP_CSS_URL = LP_PLUGIN_URL . 'assets/css/';
@@ -24,11 +33,8 @@
24 33
25 34 // Turn on/off cart.
26 35 const LP_ENABLE_CART = false;
27 36
28 -// Cache group id.
29 -const LP_SESSION_CACHE_GROUP = 'learn_press_session_id';
30 -
31 37 // Table prefix.
32 38 const LP_TABLE_PREFIX = 'learnpress_';
33 39
34 40 // Define constants for custom post types.
@@ -37,8 +43,12 @@
37 43 const LP_QUESTION_CPT = 'lp_question';
38 44 const LP_QUIZ_CPT = 'lp_quiz';
39 45 const LP_ORDER_CPT = 'lp_order';
40 46
47 +// Define constants for custom taxonomies.
48 +const LP_COURSE_CATEGORY_TAX = 'course_category';
49 +const LP_COURSE_TAXONOMY_TAG = 'course_tag';
50 +
41 51 // Role of user .
42 52 const LP_TEACHER_ROLE = 'lp_teacher';
43 53 const ADMIN_ROLE = 'administrator';
44 54
@@ -61,8 +71,11 @@
61 71 const LP_PAGE_QUESTION = 'lp_page_question';
62 72 const LP_PAGE_PROFILE = 'lp_page_profile';
63 73 const LP_PAGE_BECOME_A_TEACHER = 'lp_page_become_a_teacher';
64 74 const LP_PAGE_SINGLE_COURSE_CURRICULUM = 'lp_page_single_course_curriculum';
75 +const LP_PAGE_INSTRUCTORS = 'lp_page_instructors';
76 +const LP_PAGE_INSTRUCTOR = 'lp_page_single_instructor';
77 +const LP_PAGE_COURSE_BUILDER = 'lp_page_course_builder';
65 78
66 79 // Key block course's item.
67 80 const LP_BLOCK_COURSE_FINISHED = 'block_course_finished';
68 81 const LP_BLOCK_COURSE_DURATION_EXPIRE = 'block_course_duration_expire';
@@ -68,17 +81,43 @@
68 81 const LP_BLOCK_COURSE_DURATION_EXPIRE = 'block_course_duration_expire';
69 82 const LP_BLOCK_COURSE_PURCHASE = 'block_course_purchased';
70 83
71 84 // Status user item course.
72 -const LP_COURSE_ENROLLED = 'enrolled';
73 -const LP_COURSE_FINISHED = 'finished';
74 -const LP_COURSE_PURCHASED = 'purchased';
75 -const LP_ITEM_COMPLETED = 'completed';
76 -const LP_ITEM_STARTED = 'started';
85 +const LP_COURSE_ENROLLED = 'enrolled';
86 +const LP_COURSE_FINISHED = 'finished';
87 +const LP_COURSE_PURCHASED = 'purchased';
88 +const LP_USER_COURSE_CANCEL = 'cancel'; // When Order change complete to another status
89 +const LP_ITEM_COMPLETED = 'completed';
90 +const LP_ITEM_STARTED = 'started';
77 91
92 +// Status LP Order to compare.
93 +const LP_ORDER_COMPLETED = 'completed';
94 +const LP_ORDER_PENDING = 'pending';
95 +const LP_ORDER_PROCESSING = 'processing';
96 +const LP_ORDER_CANCELLED = 'cancelled';
97 +const LP_ORDER_FAILED = 'failed';
98 +const LP_ORDER_REFUNDED = 'refunded';
99 +const LP_ORDER_TRASH = 'trash';
100 +
101 +// Status LP Order to set DB.
102 +const LP_ORDER_COMPLETED_DB = 'lp-completed';
103 +const LP_ORDER_PENDING_DB = 'lp-pending';
104 +const LP_ORDER_PROCESSING_DB = 'lp-processing';
105 +const LP_ORDER_CANCELLED_DB = 'lp-cancelled';
106 +const LP_ORDER_FAILED_DB = 'lp-failed';
107 +const LP_ORDER_REFUNDED_DB = 'lp-refunded';
108 +const LP_ORDER_TRASH_DB = 'lp-trash';
109 +
110 +// LP Order type create via.
111 +const LP_ORDER_CREATED_VIA_MANUAL = 'manual';
112 +
78 113 // Graduation user item course
79 114 const LP_COURSE_GRADUATION_IN_PROGRESS = 'in-progress';
80 115 const LP_COURSE_GRADUATION_PASSED = 'passed';
81 116 const LP_COURSE_GRADUATION_FAILED = 'failed';
117 +// @since 4.2.7.4
118 +const LP_GRADUATION_IN_PROGRESS = 'in-progress';
119 +const LP_GRADUATION_PASSED = 'passed';
120 +const LP_GRADUATION_FAILED = 'failed';
82 121
83 122 // Enable lazy-load animation placeholder.
84 -const LP_LAZY_LOAD_ANIMATION = true;
123 +//const LP_LAZY_LOAD_ANIMATION = true;