@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function widget( $args, $instance ) { |
55 | 55 | |
56 | - $before_widget = $args[ 'before_widget' ]; |
|
57 | - $before_title = $args[ 'before_title' ]; |
|
58 | - $after_title = $args[ 'after_title' ]; |
|
59 | - $after_widget = $args[ 'after_widget' ]; |
|
56 | + $before_widget = $args[ 'before_widget' ]; |
|
57 | + $before_title = $args[ 'before_title' ]; |
|
58 | + $after_title = $args[ 'after_title' ]; |
|
59 | + $after_widget = $args[ 'after_widget' ]; |
|
60 | 60 | |
61 | 61 | if ( in_array( $instance['component'], array_keys( $this->woo_widget_componentslist ) ) && ( 'activecourses' == $instance['component'] || 'completedcourses' == $instance['component'] ) && !is_user_logged_in() ) { |
62 | 62 | // No Output |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param array $instance The settings for this instance. |
118 | 118 | * @return void |
119 | 119 | */ |
120 | - public function form( $instance ) { |
|
120 | + public function form( $instance ) { |
|
121 | 121 | |
122 | 122 | /* Set up some default widget settings. */ |
123 | 123 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | $post_args = array( 'post_type' => 'lesson', |
173 | 173 | 'posts_per_page' => intval( $instance[ 'limit' ] ), |
174 | 174 | 'orderby' => 'menu_order date', |
175 | - 'order' => 'DESC', |
|
176 | - 'post_status' => 'publish', |
|
175 | + 'order' => 'DESC', |
|
176 | + 'post_status' => 'publish', |
|
177 | 177 | 'suppress_filters' => 0 |
178 | 178 | ); |
179 | 179 | $posts_array = get_posts( $post_args ); |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | if ( count( $posts_array ) > 0 ) { ?> |
182 | 182 | <ul> |
183 | 183 | <?php foreach ($posts_array as $post_item){ |
184 | - $post_id = absint( $post_item->ID ); |
|
185 | - $post_title = $post_item->post_title; |
|
186 | - $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
187 | - $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
188 | - $author_display_name = $user_info->display_name; |
|
189 | - $author_id = $post_item->post_author; |
|
190 | - $lesson_course_id = get_post_meta( $post_id, '_lesson_course', true ); |
|
191 | - ?> |
|
184 | + $post_id = absint( $post_item->ID ); |
|
185 | + $post_title = $post_item->post_title; |
|
186 | + $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
187 | + $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
188 | + $author_display_name = $user_info->display_name; |
|
189 | + $author_id = $post_item->post_author; |
|
190 | + $lesson_course_id = get_post_meta( $post_id, '_lesson_course', true ); |
|
191 | + ?> |
|
192 | 192 | <li class="fix"> |
193 | 193 | <?php do_action( 'sensei_lesson_image', $post_id, '100', '100', false, true ); ?> |
194 | 194 | <a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a> |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function widget( $args, $instance ) { |
52 | 52 | |
53 | - $before_widget = $args[ 'before_widget' ]; |
|
54 | - $before_title = $args[ 'before_title' ]; |
|
55 | - $after_title = $args[ 'after_title' ]; |
|
56 | - $after_widget = $args[ 'after_widget' ]; |
|
53 | + $before_widget = $args[ 'before_widget' ]; |
|
54 | + $before_title = $args[ 'before_title' ]; |
|
55 | + $after_title = $args[ 'after_title' ]; |
|
56 | + $after_widget = $args[ 'after_widget' ]; |
|
57 | 57 | |
58 | 58 | /* Our variables from the widget settings. */ |
59 | 59 | $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param array $instance The settings for this instance. |
111 | 111 | * @return void |
112 | 112 | */ |
113 | - public function form( $instance ) { |
|
113 | + public function form( $instance ) { |
|
114 | 114 | |
115 | 115 | /* Set up some default widget settings. */ |
116 | 116 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | $post_args = array( 'post_type' => 'course', |
158 | 158 | 'posts_per_page' => intval( $instance[ 'limit' ] ), |
159 | 159 | 'orderby' => 'menu_order date', |
160 | - 'order' => 'ASC', |
|
161 | - 'post_status' => 'publish', |
|
160 | + 'order' => 'ASC', |
|
161 | + 'post_status' => 'publish', |
|
162 | 162 | 'suppress_filters' => 0, |
163 | 163 | ); |
164 | 164 | |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | if ( count( $posts_array ) > 0 ) { ?> |
176 | 176 | <ul> |
177 | 177 | <?php foreach ($posts_array as $post_item){ |
178 | - $post_id = absint( $post_item->ID ); |
|
179 | - $post_title = $post_item->post_title; |
|
180 | - $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
181 | - $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
182 | - $author_display_name = $user_info->display_name; |
|
183 | - $author_id = $post_item->post_author; |
|
184 | - ?> |
|
178 | + $post_id = absint( $post_item->ID ); |
|
179 | + $post_title = $post_item->post_title; |
|
180 | + $user_info = get_userdata( absint( $post_item->post_author ) ); |
|
181 | + $author_link = get_author_posts_url( absint( $post_item->post_author ) ); |
|
182 | + $author_display_name = $user_info->display_name; |
|
183 | + $author_id = $post_item->post_author; |
|
184 | + ?> |
|
185 | 185 | <li class="fix"> |
186 | 186 | <?php do_action( 'sensei_course_image', $post_id ); ?> |
187 | 187 | <a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a> |
@@ -49,31 +49,31 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function widget( $args, $instance ) { |
51 | 51 | |
52 | - $before_widget = $args[ 'before_widget' ]; |
|
53 | - $before_title = $args[ 'before_title' ]; |
|
54 | - $after_title = $args[ 'after_title' ]; |
|
55 | - $after_widget = $args[ 'after_widget' ]; |
|
52 | + $before_widget = $args[ 'before_widget' ]; |
|
53 | + $before_title = $args[ 'before_title' ]; |
|
54 | + $after_title = $args[ 'after_title' ]; |
|
55 | + $after_widget = $args[ 'after_widget' ]; |
|
56 | 56 | |
57 | - /* Our variables from the widget settings. */ |
|
58 | - $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base ); |
|
57 | + /* Our variables from the widget settings. */ |
|
58 | + $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base ); |
|
59 | 59 | |
60 | - /* Before widget (defined by themes). */ |
|
61 | - echo $before_widget; |
|
60 | + /* Before widget (defined by themes). */ |
|
61 | + echo $before_widget; |
|
62 | 62 | |
63 | - /* Display the widget title if one was input (before and after defined by themes). */ |
|
64 | - if ( $title ) { echo $before_title . $title . $after_title; } |
|
63 | + /* Display the widget title if one was input (before and after defined by themes). */ |
|
64 | + if ( $title ) { echo $before_title . $title . $after_title; } |
|
65 | 65 | |
66 | - /* Widget content. */ |
|
67 | - // Add actions for plugins/themes to hook onto. |
|
68 | - do_action( $this->woo_widget_cssclass . '_top' ); |
|
66 | + /* Widget content. */ |
|
67 | + // Add actions for plugins/themes to hook onto. |
|
68 | + do_action( $this->woo_widget_cssclass . '_top' ); |
|
69 | 69 | |
70 | - $this->load_component( $instance ); |
|
70 | + $this->load_component( $instance ); |
|
71 | 71 | |
72 | - // Add actions for plugins/themes to hook onto. |
|
73 | - do_action( $this->woo_widget_cssclass . '_bottom' ); |
|
72 | + // Add actions for plugins/themes to hook onto. |
|
73 | + do_action( $this->woo_widget_cssclass . '_bottom' ); |
|
74 | 74 | |
75 | - /* After widget (defined by themes). */ |
|
76 | - echo $after_widget; |
|
75 | + /* After widget (defined by themes). */ |
|
76 | + echo $after_widget; |
|
77 | 77 | |
78 | 78 | } // End widget() |
79 | 79 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * @param array $instance The settings for this instance. |
108 | 108 | * @return void |
109 | 109 | */ |
110 | - public function form( $instance ) { |
|
110 | + public function form( $instance ) { |
|
111 | 111 | |
112 | 112 | /* Set up some default widget settings. */ |
113 | 113 | /* Make sure all keys are added here, even with empty string values. */ |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | * @since 1.4.0 |
11 | 11 | */ |
12 | 12 | class Sensei_Learner_Profiles { |
13 | - /** |
|
14 | - * @var string |
|
15 | - */ |
|
16 | - private $profile_url_base; |
|
13 | + /** |
|
14 | + * @var string |
|
15 | + */ |
|
16 | + private $profile_url_base; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Constructor. |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function setup_permastruct() { |
44 | 44 | |
45 | - if( isset( Sensei()->settings->settings[ 'learner_profile_enable' ] ) |
|
46 | - && Sensei()->settings->settings[ 'learner_profile_enable' ] ) { |
|
45 | + if( isset( Sensei()->settings->settings[ 'learner_profile_enable' ] ) |
|
46 | + && Sensei()->settings->settings[ 'learner_profile_enable' ] ) { |
|
47 | 47 | |
48 | 48 | add_rewrite_rule( '^' . $this->profile_url_base . '/([^/]*)/?', 'index.php?learner_profile=$matches[1]', 'top' ); |
49 | 49 | add_rewrite_tag( '%learner_profile%', '([^&]+)' ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if( isset( $wp_query->query_vars['learner_profile'] ) ) { |
63 | 63 | $learner_user = get_user_by( 'login', $wp_query->query_vars['learner_profile'] ); |
64 | 64 | |
65 | - $name = Sensei_Learner::get_full_name( $learner_user->ID ); |
|
65 | + $name = Sensei_Learner::get_full_name( $learner_user->ID ); |
|
66 | 66 | |
67 | 67 | $title = apply_filters( 'sensei_learner_profile_courses_heading', sprintf( __( 'Courses %s is taking', 'woothemes-sensei' ), $name ) ) . ' ' . $sep . ' '; |
68 | 68 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if( isset( $wp_query->query_vars['learner_profile'] ) ) { |
112 | 112 | |
113 | - Sensei_Templates::get_template( 'learner-profile/learner-info.php' ); |
|
113 | + Sensei_Templates::get_template( 'learner-profile/learner-info.php' ); |
|
114 | 114 | |
115 | 115 | } |
116 | 116 | } |
@@ -140,43 +140,43 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public static function user_info( $user ) { |
142 | 142 | |
143 | - /** |
|
144 | - * This hooke fires inside the Sensei_Learner_Profiles::user_info function. |
|
145 | - * just before the htmls is generated. |
|
146 | - * @since 1.0.0 |
|
147 | - */ |
|
148 | - do_action( 'sensei_learner_profile_info', $user ); |
|
149 | - |
|
150 | - /** |
|
151 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
152 | - * Here you can change the user avatar. |
|
153 | - * |
|
154 | - * @since 1.0.0 |
|
155 | - * |
|
156 | - * @param false|string `<img>` $user_avatar |
|
157 | - */ |
|
143 | + /** |
|
144 | + * This hooke fires inside the Sensei_Learner_Profiles::user_info function. |
|
145 | + * just before the htmls is generated. |
|
146 | + * @since 1.0.0 |
|
147 | + */ |
|
148 | + do_action( 'sensei_learner_profile_info', $user ); |
|
149 | + |
|
150 | + /** |
|
151 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
152 | + * Here you can change the user avatar. |
|
153 | + * |
|
154 | + * @since 1.0.0 |
|
155 | + * |
|
156 | + * @param false|string `<img>` $user_avatar |
|
157 | + */ |
|
158 | 158 | $learner_avatar = apply_filters( 'sensei_learner_profile_info_avatar', get_avatar( $user->ID, 120 ), $user->ID ); |
159 | 159 | |
160 | - /** |
|
161 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
162 | - * Here you can change the learner profile user display name. |
|
163 | - * @since 1.0.0 |
|
164 | - * |
|
165 | - * @param string $user_display_name |
|
166 | - * @param string $user_id |
|
167 | - */ |
|
160 | + /** |
|
161 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
162 | + * Here you can change the learner profile user display name. |
|
163 | + * @since 1.0.0 |
|
164 | + * |
|
165 | + * @param string $user_display_name |
|
166 | + * @param string $user_id |
|
167 | + */ |
|
168 | 168 | $learner_name = apply_filters( 'sensei_learner_profile_info_name', $user->display_name, $user->ID ); |
169 | 169 | |
170 | - /** |
|
171 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
172 | - * With this filter can change the users description on the learner user info |
|
173 | - * output. |
|
174 | - * |
|
175 | - * @since 1.0.0 |
|
176 | - * |
|
177 | - * @param string $user_description |
|
178 | - * @param string $user_id |
|
179 | - */ |
|
170 | + /** |
|
171 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
172 | + * With this filter can change the users description on the learner user info |
|
173 | + * output. |
|
174 | + * |
|
175 | + * @since 1.0.0 |
|
176 | + * |
|
177 | + * @param string $user_description |
|
178 | + * @param string $user_id |
|
179 | + */ |
|
180 | 180 | $learner_bio = apply_filters( 'sensei_learner_profile_info_bio', $user->description, $user->ID ); |
181 | 181 | ?> |
182 | 182 | |
@@ -210,16 +210,16 @@ discard block |
||
210 | 210 | return $classes; |
211 | 211 | } |
212 | 212 | |
213 | - /** |
|
214 | - * Deprecate the deprecate_sensei_learner_profile_content hook |
|
215 | - * |
|
216 | - * @since 1.9.0 |
|
217 | - */ |
|
218 | - public static function deprecate_sensei_learner_profile_content_hook(){ |
|
213 | + /** |
|
214 | + * Deprecate the deprecate_sensei_learner_profile_content hook |
|
215 | + * |
|
216 | + * @since 1.9.0 |
|
217 | + */ |
|
218 | + public static function deprecate_sensei_learner_profile_content_hook(){ |
|
219 | 219 | |
220 | - sensei_do_deprecated_action( 'sensei_learner_profile_content', '1.9.0', 'sensei_learner_profile_content_before' ); |
|
220 | + sensei_do_deprecated_action( 'sensei_learner_profile_content', '1.9.0', 'sensei_learner_profile_content_before' ); |
|
221 | 221 | |
222 | - } |
|
222 | + } |
|
223 | 223 | |
224 | 224 | |
225 | 225 | } // End Class |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | class Sensei_Grading_Main extends WooThemes_Sensei_List_Table { |
12 | 12 | |
13 | - public $user_id; |
|
13 | + public $user_id; |
|
14 | 14 | public $course_id; |
15 | 15 | public $lesson_id; |
16 | 16 | public $view; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $grade = __( 'N/A', 'woothemes-sensei' ); |
250 | 250 | } |
251 | 251 | |
252 | - $title = Sensei_Learner::get_full_name( $item->user_id ); |
|
252 | + $title = Sensei_Learner::get_full_name( $item->user_id ); |
|
253 | 253 | |
254 | 254 | // QuizID to be deprecated |
255 | 255 | $quiz_id = get_post_meta( $item->comment_post_ID, '_lesson_quiz', true ); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function no_items() { |
301 | 301 | |
302 | - _e( 'No submissions found.', 'woothemes-sensei' ); |
|
302 | + _e( 'No submissions found.', 'woothemes-sensei' ); |
|
303 | 303 | |
304 | 304 | } // End no_items() |
305 | 305 |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | // Output users data |
233 | - $user_name = Sensei_Learner::get_full_name( $item->user_id ); |
|
233 | + $user_name = Sensei_Learner::get_full_name( $item->user_id ); |
|
234 | 234 | |
235 | - if ( !$this->csv_output ) { |
|
235 | + if ( !$this->csv_output ) { |
|
236 | 236 | $url = add_query_arg( array( 'page' => $this->page_slug, 'user_id' => $item->user_id, 'course_id' => $this->course_id ), admin_url( 'admin.php' ) ); |
237 | 237 | |
238 | 238 | $user_name = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . $user_name . '</a></strong>'; |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function search_button( $text = '' ) { |
341 | 341 | |
342 | - $text = __( 'Search Learners', 'woothemes-sensei' ); |
|
342 | + $text = __( 'Search Learners', 'woothemes-sensei' ); |
|
343 | 343 | |
344 | - return $text; |
|
344 | + return $text; |
|
345 | 345 | |
346 | 346 | } |
347 | 347 | } // End Class |
@@ -1,36 +1,36 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Class Sensei_Twentyeleven |
|
4 | - * |
|
5 | - * Responsible for wrapping twenty eleven theme Sensei content |
|
6 | - * with the correct markup |
|
7 | - * |
|
8 | - * @package Views |
|
9 | - * @subpackage Theme-Integration |
|
10 | - * @author Automattic |
|
11 | - * |
|
12 | - * @since 1.9.0 |
|
3 | + * Class Sensei_Twentyeleven |
|
4 | + * |
|
5 | + * Responsible for wrapping twenty eleven theme Sensei content |
|
6 | + * with the correct markup |
|
7 | + * |
|
8 | + * @package Views |
|
9 | + * @subpackage Theme-Integration |
|
10 | + * @author Automattic |
|
11 | + * |
|
12 | + * @since 1.9.0 |
|
13 | 13 | */ |
14 | 14 | Class Sensei_Twentyeleven { |
15 | 15 | |
16 | - /** |
|
17 | - * Output opening wrappers |
|
18 | - * @since 1.9.0 |
|
19 | - */ |
|
20 | - public function wrapper_start(){ |
|
21 | - ?> |
|
16 | + /** |
|
17 | + * Output opening wrappers |
|
18 | + * @since 1.9.0 |
|
19 | + */ |
|
20 | + public function wrapper_start(){ |
|
21 | + ?> |
|
22 | 22 | |
23 | 23 | <div id="primary"> |
24 | 24 | <div id="content" role="main"> |
25 | 25 | |
26 | 26 | <?php } |
27 | 27 | |
28 | - /** |
|
29 | - * Output closing wrappers |
|
30 | - * |
|
31 | - * @since 1.9.0 |
|
32 | - */ |
|
33 | - public function wrapper_end(){ ?> |
|
28 | + /** |
|
29 | + * Output closing wrappers |
|
30 | + * |
|
31 | + * @since 1.9.0 |
|
32 | + */ |
|
33 | + public function wrapper_end(){ ?> |
|
34 | 34 | |
35 | 35 | </div> |
36 | 36 | </div> |
@@ -627,7 +627,7 @@ |
||
627 | 627 | $course = get_post( $this->course_id ); |
628 | 628 | $report = sanitize_title( $course->post_title ) . '-' . $this->view . 's-overview'; |
629 | 629 | if ( $this->user_id ) { |
630 | - $user_name = Sensei_Learner::get_full_name( $this->user_id ); |
|
630 | + $user_name = Sensei_Learner::get_full_name( $this->user_id ); |
|
631 | 631 | $report = sanitize_title( $user_name ) . '-' . $report; |
632 | 632 | } |
633 | 633 |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | // Only show course & lesson excerpts in search results |
70 | 70 | add_filter( 'the_content', array( $this, 'sensei_search_results_excerpt' ) ); |
71 | 71 | |
72 | - //Use WooCommerce filter to show admin bar to Teachers. |
|
73 | - add_action( 'init', array( $this, 'sensei_show_admin_bar') ); |
|
72 | + //Use WooCommerce filter to show admin bar to Teachers. |
|
73 | + add_action( 'init', array( $this, 'sensei_show_admin_bar') ); |
|
74 | 74 | |
75 | - // Remove course from active courses if an order is cancelled or refunded |
|
75 | + // Remove course from active courses if an order is cancelled or refunded |
|
76 | 76 | add_action( 'woocommerce_order_status_processing_to_cancelled', array( $this, 'remove_active_course' ), 10, 1 ); |
77 | 77 | add_action( 'woocommerce_order_status_completed_to_cancelled', array( $this, 'remove_active_course' ), 10, 1 ); |
78 | 78 | add_action( 'woocommerce_order_status_on-hold_to_cancelled', array( $this, 'remove_active_course' ), 10, 1 ); |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | wp_enqueue_script( Sensei()->token . '-user-dashboard' ); |
134 | 134 | |
135 | 135 | |
136 | - // Course Archive javascript |
|
137 | - if( is_post_type_archive( 'course' ) ){ |
|
136 | + // Course Archive javascript |
|
137 | + if( is_post_type_archive( 'course' ) ){ |
|
138 | 138 | |
139 | - wp_register_script( 'sensei-course-archive-js', esc_url( Sensei()->plugin_url . 'assets/js/frontend/course-archive' . $suffix . '.js' ), array( 'jquery' ), '1', true ); |
|
140 | - wp_enqueue_script( 'sensei-course-archive-js' ); |
|
139 | + wp_register_script( 'sensei-course-archive-js', esc_url( Sensei()->plugin_url . 'assets/js/frontend/course-archive' . $suffix . '.js' ), array( 'jquery' ), '1', true ); |
|
140 | + wp_enqueue_script( 'sensei-course-archive-js' ); |
|
141 | 141 | |
142 | - } |
|
142 | + } |
|
143 | 143 | |
144 | 144 | |
145 | 145 | // Allow additional scripts to be loaded |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | /** |
181 | 181 | * sensei_get_template_part function. |
182 | 182 | * |
183 | - * @deprecated sine 1.9.0 |
|
183 | + * @deprecated sine 1.9.0 |
|
184 | 184 | * @access public |
185 | 185 | * @param mixed $slug |
186 | 186 | * @param string $name (default: '') |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | */ |
189 | 189 | function sensei_get_template_part( $slug, $name = '' ) { |
190 | 190 | |
191 | - _deprecated_function( 'class-woothemes-sensei-frontend.php', '1.9.0', 'Sensei_Templates::get_part' ); |
|
192 | - Sensei_Templates::get_part( $slug, $name ); |
|
191 | + _deprecated_function( 'class-woothemes-sensei-frontend.php', '1.9.0', 'Sensei_Templates::get_part' ); |
|
192 | + Sensei_Templates::get_part( $slug, $name ); |
|
193 | 193 | |
194 | 194 | } // End sensei_get_template_part() |
195 | 195 | |
196 | 196 | /** |
197 | 197 | * sensei_get_template function. |
198 | 198 | * |
199 | - * @deprecated since 1.9.0 |
|
199 | + * @deprecated since 1.9.0 |
|
200 | 200 | * @access public |
201 | 201 | * @param mixed $template_name |
202 | 202 | * @param array $args (default: array()) |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | */ |
207 | 207 | function sensei_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) { |
208 | 208 | |
209 | - _deprecated_function( 'sensei_get_template', '1.9.0', 'Sensei_Templates::get_template' ); |
|
210 | - Sensei_Templates::get_template($template_name, $args, $template_path, $default_path ); |
|
209 | + _deprecated_function( 'sensei_get_template', '1.9.0', 'Sensei_Templates::get_template' ); |
|
210 | + Sensei_Templates::get_template($template_name, $args, $template_path, $default_path ); |
|
211 | 211 | |
212 | 212 | } // End sensei_get_template() |
213 | 213 | |
@@ -223,33 +223,33 @@ discard block |
||
223 | 223 | */ |
224 | 224 | function sensei_locate_template( $template_name, $template_path = '', $default_path = '' ) { |
225 | 225 | |
226 | - _deprecated_function( 'sensei_locate_template', '1.9.0', 'Sensei_Templates::locate_template' ); |
|
227 | - Sensei_Templates::locate_template( $template_name, $template_path, $default_path ); |
|
226 | + _deprecated_function( 'sensei_locate_template', '1.9.0', 'Sensei_Templates::locate_template' ); |
|
227 | + Sensei_Templates::locate_template( $template_name, $template_path, $default_path ); |
|
228 | 228 | |
229 | 229 | } // End sensei_locate_template() |
230 | 230 | |
231 | 231 | |
232 | 232 | /** |
233 | 233 | * sensei_output_content_wrapper function. |
234 | - * |
|
234 | + * |
|
235 | 235 | * @access public |
236 | 236 | * @return void |
237 | 237 | */ |
238 | 238 | function sensei_output_content_wrapper() { |
239 | 239 | |
240 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
241 | - $backwards_compatible_wrapper_location = array( |
|
242 | - Sensei()->template_url . 'wrappers/wrapper-start.php', |
|
243 | - 'wrappers/wrapper-start.php' |
|
244 | - ); |
|
240 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
241 | + $backwards_compatible_wrapper_location = array( |
|
242 | + Sensei()->template_url . 'wrappers/wrapper-start.php', |
|
243 | + 'wrappers/wrapper-start.php' |
|
244 | + ); |
|
245 | 245 | |
246 | - $template = locate_template( $backwards_compatible_wrapper_location ); |
|
247 | - if( !empty( $template ) ){ |
|
246 | + $template = locate_template( $backwards_compatible_wrapper_location ); |
|
247 | + if( !empty( $template ) ){ |
|
248 | 248 | |
249 | - Sensei_Templates::get_template( 'wrappers/wrapper-start.php' ); |
|
250 | - return; |
|
249 | + Sensei_Templates::get_template( 'wrappers/wrapper-start.php' ); |
|
250 | + return; |
|
251 | 251 | |
252 | - } |
|
252 | + } |
|
253 | 253 | |
254 | 254 | Sensei_Templates::get_template( 'globals/wrapper-start.php' ); |
255 | 255 | |
@@ -258,25 +258,25 @@ discard block |
||
258 | 258 | |
259 | 259 | /** |
260 | 260 | * sensei_output_content_wrapper_end function. |
261 | - * |
|
261 | + * |
|
262 | 262 | * @access public |
263 | 263 | * @return void |
264 | 264 | */ |
265 | 265 | function sensei_output_content_wrapper_end() { |
266 | 266 | |
267 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
268 | - $backwards_compatible_wrapper_location = array( |
|
269 | - Sensei()->template_url . 'wrappers/wrapper-end.php', |
|
270 | - 'wrappers/wrapper-end.php' |
|
271 | - ); |
|
267 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
268 | + $backwards_compatible_wrapper_location = array( |
|
269 | + Sensei()->template_url . 'wrappers/wrapper-end.php', |
|
270 | + 'wrappers/wrapper-end.php' |
|
271 | + ); |
|
272 | 272 | |
273 | - $backwards_compatible_template = locate_template( $backwards_compatible_wrapper_location ); |
|
274 | - if( !empty( $backwards_compatible_template ) ){ |
|
273 | + $backwards_compatible_template = locate_template( $backwards_compatible_wrapper_location ); |
|
274 | + if( !empty( $backwards_compatible_template ) ){ |
|
275 | 275 | |
276 | - Sensei_Templates::get_template( 'wrappers/wrapper-end.php' ); |
|
277 | - return; |
|
276 | + Sensei_Templates::get_template( 'wrappers/wrapper-end.php' ); |
|
277 | + return; |
|
278 | 278 | |
279 | - } |
|
279 | + } |
|
280 | 280 | |
281 | 281 | |
282 | 282 | Sensei_Templates::get_template( 'globals/wrapper-end.php' ); |
@@ -292,55 +292,55 @@ discard block |
||
292 | 292 | */ |
293 | 293 | public static function load_content_pagination() { |
294 | 294 | |
295 | - if( is_singular('course') ) { |
|
295 | + if( is_singular('course') ) { |
|
296 | 296 | |
297 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
298 | - $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-posts.php' ) ); |
|
299 | - if( !empty( $template ) ){ |
|
297 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
298 | + $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-posts.php' ) ); |
|
299 | + if( !empty( $template ) ){ |
|
300 | 300 | |
301 | - Sensei_Templates::get_template( 'wrappers/pagination-posts.php' ); |
|
302 | - return; |
|
301 | + Sensei_Templates::get_template( 'wrappers/pagination-posts.php' ); |
|
302 | + return; |
|
303 | 303 | |
304 | - } |
|
304 | + } |
|
305 | 305 | |
306 | 306 | Sensei_Templates::get_template( 'globals/pagination-posts.php' ); |
307 | 307 | |
308 | 308 | } elseif( is_singular('lesson') ) { |
309 | 309 | |
310 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
311 | - $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-lesson.php' ) ); |
|
312 | - if( !empty( $template ) ){ |
|
310 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
311 | + $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-lesson.php' ) ); |
|
312 | + if( !empty( $template ) ){ |
|
313 | 313 | |
314 | - Sensei_Templates::get_template( 'wrappers/pagination-lesson.php' ); |
|
315 | - return; |
|
314 | + Sensei_Templates::get_template( 'wrappers/pagination-lesson.php' ); |
|
315 | + return; |
|
316 | 316 | |
317 | - } |
|
317 | + } |
|
318 | 318 | |
319 | 319 | Sensei_Templates::get_template( 'globals/pagination-lesson.php' ); |
320 | 320 | |
321 | 321 | } elseif( is_singular('quiz') ) { |
322 | 322 | |
323 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
324 | - $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-quiz.php' ) ); |
|
325 | - if( !empty( $template ) ){ |
|
323 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
324 | + $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination-quiz.php' ) ); |
|
325 | + if( !empty( $template ) ){ |
|
326 | 326 | |
327 | - Sensei_Templates::get_template( 'wrappers/pagination-quiz.php' ); |
|
328 | - return; |
|
327 | + Sensei_Templates::get_template( 'wrappers/pagination-quiz.php' ); |
|
328 | + return; |
|
329 | 329 | |
330 | - } |
|
330 | + } |
|
331 | 331 | |
332 | 332 | Sensei_Templates::get_template( 'globals/pagination-quiz.php' ); |
333 | 333 | |
334 | 334 | } else { |
335 | 335 | |
336 | - // backwards compatibility check for old location under the wrappers directory of the active theme |
|
337 | - $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination.php' ) ); |
|
338 | - if( !empty( $template ) ){ |
|
336 | + // backwards compatibility check for old location under the wrappers directory of the active theme |
|
337 | + $template = locate_template( array( Sensei()->template_url . 'wrappers/pagination.php' ) ); |
|
338 | + if( !empty( $template ) ){ |
|
339 | 339 | |
340 | - Sensei_Templates::get_template( 'wrappers/pagination.php' ); |
|
341 | - return; |
|
340 | + Sensei_Templates::get_template( 'wrappers/pagination.php' ); |
|
341 | + return; |
|
342 | 342 | |
343 | - } |
|
343 | + } |
|
344 | 344 | |
345 | 345 | Sensei_Templates::get_template( 'globals/pagination.php' ); |
346 | 346 | |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | |
398 | 398 | case '#senseimymessages': |
399 | 399 | $item->url = $my_messages_url; |
400 | - // if no archive link exist for sensei_message |
|
401 | - // set it back to the place holder |
|
402 | - if( ! $item->url ){ |
|
400 | + // if no archive link exist for sensei_message |
|
401 | + // set it back to the place holder |
|
402 | + if( ! $item->url ){ |
|
403 | 403 | |
404 | - $item->url = '#senseimymessages'; |
|
404 | + $item->url = '#senseimymessages'; |
|
405 | 405 | |
406 | - } |
|
406 | + } |
|
407 | 407 | break; |
408 | 408 | |
409 | 409 | case '#senseilearnerprofile': |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | // Remove the My Messages link for logged out users or if Private Messages are disabled |
471 | 471 | if( ! get_post_type_archive_link( 'sensei_message' ) |
472 | - && '#senseimymessages' == $item->url ) { |
|
472 | + && '#senseimymessages' == $item->url ) { |
|
473 | 473 | |
474 | 474 | if ( !is_user_logged_in() || ( isset( Sensei()->settings->settings['messages_disable'] ) && Sensei()->settings->settings['messages_disable'] ) ) { |
475 | 475 | |
@@ -492,42 +492,42 @@ discard block |
||
492 | 492 | |
493 | 493 | // add category nicenames in body and post class |
494 | 494 | function sensei_search_results_classes($classes) { |
495 | - global $post; |
|
496 | - // Handle Search Classes for Courses, Lessons, and WC Products |
|
497 | - if ( isset( $post->post_type ) && ( ( 'course' == $post->post_type ) || ( 'lesson' == $post->post_type ) || ( 'product' == $post->post_type ) ) ) { |
|
498 | - $classes[] = 'post'; |
|
495 | + global $post; |
|
496 | + // Handle Search Classes for Courses, Lessons, and WC Products |
|
497 | + if ( isset( $post->post_type ) && ( ( 'course' == $post->post_type ) || ( 'lesson' == $post->post_type ) || ( 'product' == $post->post_type ) ) ) { |
|
498 | + $classes[] = 'post'; |
|
499 | 499 | } // End If Statement |
500 | - return $classes; |
|
500 | + return $classes; |
|
501 | 501 | } // End sensei_search_results_classes() |
502 | 502 | |
503 | - /** |
|
504 | - * sensei_single_title output for single page title |
|
505 | - * @since 1.1.0 |
|
506 | - * @return void |
|
507 | - * @deprecated |
|
508 | - */ |
|
509 | - function the_single_title() { |
|
503 | + /** |
|
504 | + * sensei_single_title output for single page title |
|
505 | + * @since 1.1.0 |
|
506 | + * @return void |
|
507 | + * @deprecated |
|
508 | + */ |
|
509 | + function the_single_title() { |
|
510 | 510 | |
511 | - _deprecated_function(' WooThemes_Sensei_Frontend::the_single_title', '1.9.0'); |
|
511 | + _deprecated_function(' WooThemes_Sensei_Frontend::the_single_title', '1.9.0'); |
|
512 | 512 | |
513 | - } // End sensei_single_title() |
|
513 | + } // End sensei_single_title() |
|
514 | 514 | |
515 | 515 | /** |
516 | 516 | * sensei_course_image output for course image Please use Sensei()->course->course_image instead. |
517 | - * |
|
518 | - * @deprecated since 1.9.0 |
|
519 | - * @param $course_id |
|
520 | - * @param string $width |
|
521 | - * @param string $height |
|
522 | - * @param bool|false $return |
|
523 | - * @return string|void |
|
517 | + * |
|
518 | + * @deprecated since 1.9.0 |
|
519 | + * @param $course_id |
|
520 | + * @param string $width |
|
521 | + * @param string $height |
|
522 | + * @param bool|false $return |
|
523 | + * @return string|void |
|
524 | 524 | */ |
525 | 525 | function sensei_course_image( $course_id, $width = '100', $height = '100', $return = false ) { |
526 | 526 | |
527 | - if ( ! $return ) { |
|
527 | + if ( ! $return ) { |
|
528 | 528 | |
529 | 529 | echo Sensei()->course->course_image( $course_id, $width, $height ); |
530 | - return ''; |
|
530 | + return ''; |
|
531 | 531 | |
532 | 532 | } // End If Statement |
533 | 533 | |
@@ -538,31 +538,31 @@ discard block |
||
538 | 538 | /** |
539 | 539 | * sensei_lesson_image output for lesson image |
540 | 540 | * @since 1.2.0 |
541 | - * @deprecated since 1.9.0 |
|
542 | - * @param $lesson_id |
|
543 | - * @param string $width |
|
544 | - * @param string $height |
|
545 | - * @param bool|false $return |
|
546 | - * @param bool|false $widget |
|
547 | - * @return string |
|
541 | + * @deprecated since 1.9.0 |
|
542 | + * @param $lesson_id |
|
543 | + * @param string $width |
|
544 | + * @param string $height |
|
545 | + * @param bool|false $return |
|
546 | + * @param bool|false $widget |
|
547 | + * @return string |
|
548 | 548 | */ |
549 | 549 | function sensei_lesson_image( $lesson_id, $width = '100', $height = '100', $return = false, $widget = false ) { |
550 | 550 | |
551 | - if( ! $return ){ |
|
551 | + if( ! $return ){ |
|
552 | 552 | |
553 | - echo Sensei()->lesson->lesson_image( $lesson_id, $width, $height, $widget ); |
|
554 | - return ''; |
|
555 | - } |
|
553 | + echo Sensei()->lesson->lesson_image( $lesson_id, $width, $height, $widget ); |
|
554 | + return ''; |
|
555 | + } |
|
556 | 556 | |
557 | - return Sensei()->lesson->lesson_image( $lesson_id, $width, $height, $widget ); |
|
557 | + return Sensei()->lesson->lesson_image( $lesson_id, $width, $height, $widget ); |
|
558 | 558 | |
559 | 559 | } // End sensei_lesson_image() |
560 | 560 | |
561 | - /** |
|
562 | - * @since 1.0.0 |
|
563 | - * @param WP_Query $query |
|
564 | - */ |
|
565 | - function sensei_course_archive_pagination( $query ) { |
|
561 | + /** |
|
562 | + * @since 1.0.0 |
|
563 | + * @param WP_Query $query |
|
564 | + */ |
|
565 | + function sensei_course_archive_pagination( $query ) { |
|
566 | 566 | |
567 | 567 | if( ! is_admin() && $query->is_main_query() && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'newcourses', 'featuredcourses', 'freecourses', 'paidcourses' ) ) ) { |
568 | 568 | |
@@ -585,50 +585,50 @@ discard block |
||
585 | 585 | * |
586 | 586 | * @access public |
587 | 587 | * @since 1.2.0 |
588 | - * @deprecated since 1.9.0 use WooThemes_Sensei_Course::archive_header |
|
588 | + * @deprecated since 1.9.0 use WooThemes_Sensei_Course::archive_header |
|
589 | 589 | * @return void |
590 | 590 | */ |
591 | 591 | function sensei_course_archive_header( ) { |
592 | 592 | |
593 | - trigger_error('This function sensei_course_archive_header has been depricated. Please use: WooThemes_Sensei_Course::course_archive_header '); |
|
594 | - WooThemes_Sensei_Course::archive_header( '', '<header class="archive-header"><h1>', '</h1></header>' ); |
|
593 | + trigger_error('This function sensei_course_archive_header has been depricated. Please use: WooThemes_Sensei_Course::course_archive_header '); |
|
594 | + WooThemes_Sensei_Course::archive_header( '', '<header class="archive-header"><h1>', '</h1></header>' ); |
|
595 | 595 | |
596 | 596 | } // sensei_course_archive_header() |
597 | 597 | |
598 | 598 | /** |
599 | 599 | * sensei_lesson_archive_header function. |
600 | 600 | * |
601 | - * @deprecated since 1.9.0 |
|
601 | + * @deprecated since 1.9.0 |
|
602 | 602 | * @access public |
603 | 603 | * @since 1.2.1 |
604 | 604 | * @return void |
605 | 605 | */ |
606 | 606 | public function sensei_lesson_archive_header( ) { |
607 | - _deprecated_function( 'WooThemes_Sensei_Frontend::sensei_lesson_archive_header', '1.9.0', 'WooThemes_Sensei_Lesson::the_archive_header' ); |
|
608 | - Sensei()->lesson->the_archive_header(); |
|
607 | + _deprecated_function( 'WooThemes_Sensei_Frontend::sensei_lesson_archive_header', '1.9.0', 'WooThemes_Sensei_Lesson::the_archive_header' ); |
|
608 | + Sensei()->lesson->the_archive_header(); |
|
609 | 609 | } // sensei_course_archive_header() |
610 | 610 | |
611 | - /** |
|
612 | - * @deprecated since 1.9.0 |
|
613 | - */ |
|
611 | + /** |
|
612 | + * @deprecated since 1.9.0 |
|
613 | + */ |
|
614 | 614 | public function sensei_message_archive_header( ){ |
615 | - _deprecated_function('Sensei_Frontend::sensei_message_archive_header','Please use: Sense'); |
|
616 | - Sensei_Messages::the_archive_header(); |
|
615 | + _deprecated_function('Sensei_Frontend::sensei_message_archive_header','Please use: Sense'); |
|
616 | + Sensei_Messages::the_archive_header(); |
|
617 | 617 | } // sensei_message_archive_header() |
618 | 618 | |
619 | 619 | /** |
620 | 620 | * sensei_course_archive_course_title output for course archive page individual course title |
621 | 621 | * @since 1.2.0 |
622 | - * @param WP_Post $post_item |
|
622 | + * @param WP_Post $post_item |
|
623 | 623 | * @return void |
624 | 624 | */ |
625 | 625 | function sensei_course_archive_course_title( $post_item ) { |
626 | 626 | if ( isset( $post_item->ID ) && ( 0 < $post_item->ID ) ) { |
627 | 627 | $post_id = absint( $post_item->ID ); |
628 | - $post_title = $post_item->post_title; |
|
628 | + $post_title = $post_item->post_title; |
|
629 | 629 | } else { |
630 | 630 | $post_id = get_the_ID(); |
631 | - $post_title = get_the_title(); |
|
631 | + $post_title = get_the_title(); |
|
632 | 632 | } // End If Statement |
633 | 633 | ?><header><h2><a href="<?php echo get_permalink( $post_id ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a></h2></header><?php |
634 | 634 | } // End sensei_course_archive_course_title() |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | */ |
641 | 641 | public function sensei_lesson_archive_lesson_title() { |
642 | 642 | $post_id = get_the_ID(); |
643 | - $post_title = get_the_title(); |
|
643 | + $post_title = get_the_title(); |
|
644 | 644 | ?><header><h2><a href="<?php echo get_permalink( $post_id ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a></h2></header><?php |
645 | 645 | } // End sensei_lesson_archive_lesson_title() |
646 | 646 | |
@@ -657,9 +657,9 @@ discard block |
||
657 | 657 | |
658 | 658 | if( empty( $id ) ){ |
659 | 659 | |
660 | - $id = get_the_ID(); |
|
660 | + $id = get_the_ID(); |
|
661 | 661 | |
662 | - } |
|
662 | + } |
|
663 | 663 | |
664 | 664 | $sensei_breadcrumb_prefix = __( 'Back to: ', 'woothemes-sensei' ); |
665 | 665 | $separator = apply_filters( 'sensei_breadcrumb_separator', '>' ); |
@@ -672,31 +672,31 @@ discard block |
||
672 | 672 | return; |
673 | 673 | } |
674 | 674 | $html .= '<a href="' . esc_url( get_permalink( $course_id ) ) . '" title="' . __( 'Back to the course', 'woothemes-sensei' ) . '">' . get_the_title( $course_id ) . '</a>'; |
675 | - } // End If Statement |
|
676 | - // Quiz |
|
675 | + } // End If Statement |
|
676 | + // Quiz |
|
677 | 677 | if ( is_singular( 'quiz' ) && 0 < intval( $id ) ) { |
678 | 678 | $lesson_id = intval( get_post_meta( $id, '_quiz_lesson', true ) ); |
679 | 679 | if( ! $lesson_id ) { |
680 | 680 | return; |
681 | 681 | } |
682 | 682 | $html .= '<a href="' . esc_url( get_permalink( $lesson_id ) ) . '" title="' . __( 'Back to the lesson', 'woothemes-sensei' ) . '">' . get_the_title( $lesson_id ) . '</a>'; |
683 | - } // End If Statement |
|
683 | + } // End If Statement |
|
684 | 684 | |
685 | - // Allow other plugins to filter html |
|
686 | - $html = apply_filters ( 'sensei_breadcrumb_output', $html, $separator ); |
|
687 | - $html .= '</section>'; |
|
685 | + // Allow other plugins to filter html |
|
686 | + $html = apply_filters ( 'sensei_breadcrumb_output', $html, $separator ); |
|
687 | + $html .= '</section>'; |
|
688 | 688 | |
689 | - echo $html; |
|
689 | + echo $html; |
|
690 | 690 | } // End sensei_breadcrumb() |
691 | 691 | |
692 | 692 | |
693 | - /** |
|
694 | - * @deprecated since 1.9.0 use WooThemes_Sensei_Lesson::course_signup_link instead |
|
695 | - */ |
|
693 | + /** |
|
694 | + * @deprecated since 1.9.0 use WooThemes_Sensei_Lesson::course_signup_link instead |
|
695 | + */ |
|
696 | 696 | public function sensei_lesson_course_signup_link( ) { |
697 | 697 | |
698 | - _deprecated_function('sensei_lesson_course_signup_link', '1.9.0', 'WooThemes_Sensei_Lesson::course_signup_link' ); |
|
699 | - WooThemes_Sensei_Lesson::course_signup_link(); |
|
698 | + _deprecated_function('sensei_lesson_course_signup_link', '1.9.0', 'WooThemes_Sensei_Lesson::course_signup_link' ); |
|
699 | + WooThemes_Sensei_Lesson::course_signup_link(); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | public function lesson_tags_display( $lesson_id = 0 ) { |
@@ -715,27 +715,27 @@ discard block |
||
715 | 715 | ?><section class="lesson-tags"> |
716 | 716 | <?php printf( __( 'Lesson tags: %1$s', 'woothemes-sensei' ), $tag_list ); ?> |
717 | 717 | </section><?php |
718 | - } |
|
719 | - } |
|
718 | + } |
|
719 | + } |
|
720 | 720 | } |
721 | 721 | } |
722 | 722 | |
723 | - /** |
|
724 | - * @param WP_Query $query |
|
725 | - */ |
|
723 | + /** |
|
724 | + * @param WP_Query $query |
|
725 | + */ |
|
726 | 726 | public function lesson_tag_archive_filter( $query ) { |
727 | - if( is_tax( 'lesson-tag' ) && $query->is_main_query() ) { |
|
728 | - // Limit to lessons only |
|
729 | - $query->set( 'post_type', 'lesson' ); |
|
727 | + if( is_tax( 'lesson-tag' ) && $query->is_main_query() ) { |
|
728 | + // Limit to lessons only |
|
729 | + $query->set( 'post_type', 'lesson' ); |
|
730 | 730 | |
731 | - // Set order of lessons |
|
732 | - $query->set( 'orderby', 'menu_order' ); |
|
733 | - $query->set( 'order', 'ASC' ); |
|
731 | + // Set order of lessons |
|
732 | + $query->set( 'orderby', 'menu_order' ); |
|
733 | + $query->set( 'order', 'ASC' ); |
|
734 | 734 | |
735 | - } |
|
736 | - } |
|
735 | + } |
|
736 | + } |
|
737 | 737 | |
738 | - public function lesson_tag_archive_header( $title ) { |
|
738 | + public function lesson_tag_archive_header( $title ) { |
|
739 | 739 | if( is_tax( 'lesson-tag' ) ) { |
740 | 740 | $title = sprintf( __( 'Lesson tag: %1$s', 'woothemes-sensei' ), apply_filters( 'sensei_lesson_tag_archive_title', get_queried_object()->name ) ); |
741 | 741 | } |
@@ -757,13 +757,13 @@ discard block |
||
757 | 757 | $sanitized_submit = esc_html( $_POST['quiz_action'] ); |
758 | 758 | |
759 | 759 | switch ($sanitized_submit) { |
760 | - case 'lesson-complete': |
|
760 | + case 'lesson-complete': |
|
761 | 761 | |
762 | 762 | Sensei_Utils::sensei_start_lesson( $post->ID, $current_user->ID, $complete = true ); |
763 | 763 | |
764 | 764 | break; |
765 | 765 | |
766 | - case 'lesson-reset': |
|
766 | + case 'lesson-reset': |
|
767 | 767 | |
768 | 768 | Sensei_Utils::sensei_remove_user_from_lesson( $post->ID, $current_user->ID ); |
769 | 769 | |
@@ -875,13 +875,13 @@ discard block |
||
875 | 875 | if ( 0 < intval( $post_id ) ) { |
876 | 876 | $lesson_video_embed = get_post_meta( $post_id, '_lesson_video_embed', true ); |
877 | 877 | if ( 'http' == substr( $lesson_video_embed, 0, 4) ) { |
878 | - // V2 - make width and height a setting for video embed |
|
879 | - $lesson_video_embed = wp_oembed_get( esc_url( $lesson_video_embed )/*, array( 'width' => 100 , 'height' => 100)*/ ); |
|
880 | - } // End If Statement |
|
881 | - if ( '' != $lesson_video_embed ) { |
|
882 | - ?><div class="video"><?php echo html_entity_decode($lesson_video_embed); ?></div><?php |
|
883 | - } // End If Statement |
|
884 | - } // End If Statement |
|
878 | + // V2 - make width and height a setting for video embed |
|
879 | + $lesson_video_embed = wp_oembed_get( esc_url( $lesson_video_embed )/*, array( 'width' => 100 , 'height' => 100)*/ ); |
|
880 | + } // End If Statement |
|
881 | + if ( '' != $lesson_video_embed ) { |
|
882 | + ?><div class="video"><?php echo html_entity_decode($lesson_video_embed); ?></div><?php |
|
883 | + } // End If Statement |
|
884 | + } // End If Statement |
|
885 | 885 | } // End sensei_lesson_video() |
886 | 886 | |
887 | 887 | public function sensei_complete_lesson_button() { |
@@ -894,8 +894,8 @@ discard block |
||
894 | 894 | $pass_required = true; |
895 | 895 | if( $quiz_id ) { |
896 | 896 | // Get quiz pass setting |
897 | - $pass_required = get_post_meta( $quiz_id, '_pass_required', true ); |
|
898 | - } |
|
897 | + $pass_required = get_post_meta( $quiz_id, '_pass_required', true ); |
|
898 | + } |
|
899 | 899 | if( ! $quiz_id || ( $quiz_id && ! $pass_required ) ) { |
900 | 900 | ?> |
901 | 901 | <form class="lesson_button_form" method="POST" action="<?php echo esc_url( get_permalink() ); ?>"> |
@@ -948,12 +948,12 @@ discard block |
||
948 | 948 | } // End If Statement |
949 | 949 | } // End sensei_reset_lesson_button() |
950 | 950 | |
951 | - /** |
|
952 | - * @deprecated since 1.9.0 |
|
953 | - */ |
|
954 | - public function sensei_lesson_quiz_meta( ) { |
|
951 | + /** |
|
952 | + * @deprecated since 1.9.0 |
|
953 | + */ |
|
954 | + public function sensei_lesson_quiz_meta( ) { |
|
955 | 955 | |
956 | - Sensei_Lesson::footer_quiz_call_to_action(); |
|
956 | + Sensei_Lesson::footer_quiz_call_to_action(); |
|
957 | 957 | |
958 | 958 | } // End sensei_lesson_quiz_meta() |
959 | 959 | |
@@ -979,38 +979,38 @@ discard block |
||
979 | 979 | </p> |
980 | 980 | <p class="course-excerpt"><?php the_excerpt(); ?></p> |
981 | 981 | <?php if ( 0 < $free_lesson_count ) { |
982 | - $free_lessons = sprintf( __( 'You can access %d of this course\'s lessons for free', 'woothemes-sensei' ), $free_lesson_count ); ?> |
|
982 | + $free_lessons = sprintf( __( 'You can access %d of this course\'s lessons for free', 'woothemes-sensei' ), $free_lesson_count ); ?> |
|
983 | 983 | <p class="sensei-free-lessons"><a href="<?php echo get_permalink( $post_id ); ?>"><?php _e( 'Preview this course', 'woothemes-sensei' ) ?></a> - <?php echo $free_lessons; ?></p> |
984 | 984 | <?php } ?> |
985 | 985 | </section><?php |
986 | 986 | } // End sensei_course_archive_meta() |
987 | 987 | |
988 | - /** |
|
989 | - * @deprecated since 1.9.0 |
|
990 | - */ |
|
988 | + /** |
|
989 | + * @deprecated since 1.9.0 |
|
990 | + */ |
|
991 | 991 | public function sensei_single_main_content() { |
992 | - _deprecated_function('Woothemes_Sensei_Frontend::sensei_single_main_content', '1.9.0'); |
|
992 | + _deprecated_function('Woothemes_Sensei_Frontend::sensei_single_main_content', '1.9.0'); |
|
993 | 993 | } // End sensei_single_main_content() |
994 | 994 | |
995 | - /** |
|
996 | - * @deprecated since 1.9.0 |
|
997 | - */ |
|
995 | + /** |
|
996 | + * @deprecated since 1.9.0 |
|
997 | + */ |
|
998 | 998 | public function sensei_lesson_archive_main_content() { |
999 | - _deprecated_function('Sensei_Frontend::sensei_lesson_archive_main_content', '1.9.0', 'Please include loop-lesson.php directly'); |
|
999 | + _deprecated_function('Sensei_Frontend::sensei_lesson_archive_main_content', '1.9.0', 'Please include loop-lesson.php directly'); |
|
1000 | 1000 | } // End sensei_lesson_archive_main_content() |
1001 | 1001 | |
1002 | - /** |
|
1003 | - * @deprecated since 1.9.0 |
|
1004 | - */ |
|
1002 | + /** |
|
1003 | + * @deprecated since 1.9.0 |
|
1004 | + */ |
|
1005 | 1005 | public function sensei_message_archive_main_content() { |
1006 | 1006 | _deprecated_function( 'Sensei_Frontend::sensei_message_archive_main_content', 'This method is no longer needed' ); |
1007 | 1007 | } // End sensei_lesson_archive_main_content() |
1008 | 1008 | |
1009 | - /** |
|
1010 | - * @deprecated since 1.9.0 |
|
1011 | - */ |
|
1009 | + /** |
|
1010 | + * @deprecated since 1.9.0 |
|
1011 | + */ |
|
1012 | 1012 | public function sensei_no_permissions_main_content() { |
1013 | - _deprecated_function( 'Sensei_Frontend::sensei_no_permissions_main_content', 'This method is no longer needed' ); |
|
1013 | + _deprecated_function( 'Sensei_Frontend::sensei_no_permissions_main_content', 'This method is no longer needed' ); |
|
1014 | 1014 | } // End sensei_no_permissions_main_content() |
1015 | 1015 | |
1016 | 1016 | public function sensei_course_category_main_content() { |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | <div class="col-1"> |
1059 | 1059 | <?php |
1060 | 1060 | // output the actual form markup |
1061 | - Sensei_Templates::get_template( 'user/login-form.php'); |
|
1061 | + Sensei_Templates::get_template( 'user/login-form.php'); |
|
1062 | 1062 | ?> |
1063 | 1063 | </div> |
1064 | 1064 | |
@@ -1139,12 +1139,12 @@ discard block |
||
1139 | 1139 | |
1140 | 1140 | //if this is a paid course |
1141 | 1141 | if ( Sensei_WC::is_woocommerce_active() ) { |
1142 | - $wc_post_id = get_post_meta( $course_id, '_course_woocommerce_product', true ); |
|
1143 | - if ( 0 < $wc_post_id ) { |
|
1144 | - $preview_text = __( ' (Free Preview)', 'woothemes-sensei' ); |
|
1145 | - } // End If Statement |
|
1146 | - } |
|
1147 | - return $preview_text; |
|
1142 | + $wc_post_id = get_post_meta( $course_id, '_course_woocommerce_product', true ); |
|
1143 | + if ( 0 < $wc_post_id ) { |
|
1144 | + $preview_text = __( ' (Free Preview)', 'woothemes-sensei' ); |
|
1145 | + } // End If Statement |
|
1146 | + } |
|
1147 | + return $preview_text; |
|
1148 | 1148 | } |
1149 | 1149 | |
1150 | 1150 | public function sensei_lesson_preview_title( $title = '', $id = 0 ) { |
@@ -1176,8 +1176,8 @@ discard block |
||
1176 | 1176 | $is_user_taking_course = Sensei_Utils::user_started_course( $post->ID, $current_user->ID ); |
1177 | 1177 | // Handle user starting the course |
1178 | 1178 | if ( isset( $_POST['course_start'] ) |
1179 | - && wp_verify_nonce( $_POST[ 'woothemes_sensei_start_course_noonce' ], 'woothemes_sensei_start_course_noonce' ) |
|
1180 | - && !$is_user_taking_course ) { |
|
1179 | + && wp_verify_nonce( $_POST[ 'woothemes_sensei_start_course_noonce' ], 'woothemes_sensei_start_course_noonce' ) |
|
1180 | + && !$is_user_taking_course ) { |
|
1181 | 1181 | |
1182 | 1182 | // Start the course |
1183 | 1183 | $activity_logged = Sensei_Utils::user_start_course( $current_user->ID, $post->ID ); |
@@ -1196,35 +1196,35 @@ discard block |
||
1196 | 1196 | } // End If Statement |
1197 | 1197 | } // End sensei_course_start() |
1198 | 1198 | |
1199 | - /** |
|
1200 | - * @deprecated since 1.9.0 |
|
1201 | - */ |
|
1199 | + /** |
|
1200 | + * @deprecated since 1.9.0 |
|
1201 | + */ |
|
1202 | 1202 | public function sensei_course_meta() { |
1203 | - _deprecated_function( 'Sensei_Frontend::sensei_course_meta', '1.9.0' , 'Sensei_Course::the_course_meta()' ); |
|
1204 | - Sensei()->course->the_course_meta( get_post() ); |
|
1203 | + _deprecated_function( 'Sensei_Frontend::sensei_course_meta', '1.9.0' , 'Sensei_Course::the_course_meta()' ); |
|
1204 | + Sensei()->course->the_course_meta( get_post() ); |
|
1205 | 1205 | } // End sensei_course_meta() |
1206 | 1206 | |
1207 | - /** |
|
1208 | - * @deprecated since 1.9.0 |
|
1209 | - */ |
|
1207 | + /** |
|
1208 | + * @deprecated since 1.9.0 |
|
1209 | + */ |
|
1210 | 1210 | public function sensei_course_meta_video() { |
1211 | - _deprecated_function( 'Sensei_Frontend::sensei_course_meta_video', '1.9.0' , 'Sensei_Course::the_course_video()' ); |
|
1212 | - Sensei_Course::the_course_video(); |
|
1211 | + _deprecated_function( 'Sensei_Frontend::sensei_course_meta_video', '1.9.0' , 'Sensei_Course::the_course_video()' ); |
|
1212 | + Sensei_Course::the_course_video(); |
|
1213 | 1213 | } // End sensei_course_meta_video() |
1214 | 1214 | |
1215 | - /** |
|
1216 | - * This function shows the WooCommerce cart notice if the user has |
|
1217 | - * added the current course to cart. It does not show if the user is already taking |
|
1218 | - * the course. |
|
1219 | - * |
|
1220 | - * @since 1.0.2 |
|
1221 | - * @return void; |
|
1222 | - */ |
|
1223 | - public function sensei_woocommerce_in_cart_message() { |
|
1215 | + /** |
|
1216 | + * This function shows the WooCommerce cart notice if the user has |
|
1217 | + * added the current course to cart. It does not show if the user is already taking |
|
1218 | + * the course. |
|
1219 | + * |
|
1220 | + * @since 1.0.2 |
|
1221 | + * @return void; |
|
1222 | + */ |
|
1223 | + public function sensei_woocommerce_in_cart_message() { |
|
1224 | 1224 | global $post, $woocommerce; |
1225 | 1225 | |
1226 | 1226 | $wc_post_id = absint( get_post_meta( $post->ID, '_course_woocommerce_product', true ) ); |
1227 | - $user_course_status_id = Sensei_Utils::user_started_course($post->ID , get_current_user_id() ); |
|
1227 | + $user_course_status_id = Sensei_Utils::user_started_course($post->ID , get_current_user_id() ); |
|
1228 | 1228 | if ( 0 < intval( $wc_post_id ) && ! $user_course_status_id ) { |
1229 | 1229 | |
1230 | 1230 | if ( Sensei_WC::is_product_in_cart( $wc_post_id ) ) { |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | $item_id = $item['product_id']; |
1273 | 1273 | } |
1274 | 1274 | |
1275 | - if ( $item_id > 0 ) { |
|
1275 | + if ( $item_id > 0 ) { |
|
1276 | 1276 | |
1277 | 1277 | $user_id = get_post_meta( $order_id, '_customer_user', true ); |
1278 | 1278 | |
@@ -1352,15 +1352,15 @@ discard block |
||
1352 | 1352 | |
1353 | 1353 | $items = $order->get_items(); |
1354 | 1354 | foreach( $items as $item ) { |
1355 | - if (isset($item['variation_id']) && $item['variation_id'] > 0) { |
|
1356 | - $item_id = $item['variation_id']; |
|
1357 | - $product_type = 'variation'; |
|
1358 | - } else { |
|
1359 | - $item_id = $item['product_id']; |
|
1360 | - } |
|
1355 | + if (isset($item['variation_id']) && $item['variation_id'] > 0) { |
|
1356 | + $item_id = $item['variation_id']; |
|
1357 | + $product_type = 'variation'; |
|
1358 | + } else { |
|
1359 | + $item_id = $item['product_id']; |
|
1360 | + } |
|
1361 | 1361 | |
1362 | - $product_ids[] = $item_id; |
|
1363 | - } |
|
1362 | + $product_ids[] = $item_id; |
|
1363 | + } |
|
1364 | 1364 | |
1365 | 1365 | $order_ids[] = $post_id; |
1366 | 1366 | } |
@@ -1467,32 +1467,32 @@ discard block |
||
1467 | 1467 | |
1468 | 1468 | $items = $order->get_items(); |
1469 | 1469 | foreach( $items as $item ) { |
1470 | - $product = wc_get_product( $item['product_id'] ); |
|
1470 | + $product = wc_get_product( $item['product_id'] ); |
|
1471 | 1471 | |
1472 | - // handle product bundles |
|
1473 | - if( $product->is_type('bundle') ){ |
|
1472 | + // handle product bundles |
|
1473 | + if( $product->is_type('bundle') ){ |
|
1474 | 1474 | |
1475 | - $bundled_product = new WC_Product_Bundle( $product->id ); |
|
1476 | - $bundled_items = $bundled_product->get_bundled_items(); |
|
1475 | + $bundled_product = new WC_Product_Bundle( $product->id ); |
|
1476 | + $bundled_items = $bundled_product->get_bundled_items(); |
|
1477 | 1477 | |
1478 | - foreach( $bundled_items as $bundled_item ){ |
|
1478 | + foreach( $bundled_items as $bundled_item ){ |
|
1479 | 1479 | |
1480 | - if( $bundled_item->product_id == $course_product_id ) { |
|
1481 | - Sensei_Utils::user_start_course( $user_id, $course_id ); |
|
1482 | - return; |
|
1483 | - } |
|
1480 | + if( $bundled_item->product_id == $course_product_id ) { |
|
1481 | + Sensei_Utils::user_start_course( $user_id, $course_id ); |
|
1482 | + return; |
|
1483 | + } |
|
1484 | 1484 | |
1485 | - } |
|
1485 | + } |
|
1486 | 1486 | |
1487 | - } else { |
|
1487 | + } else { |
|
1488 | 1488 | |
1489 | - // handle regular products |
|
1490 | - if( $item['product_id'] == $course_product_id ) { |
|
1491 | - Sensei_Utils::user_start_course( $user_id, $course_id ); |
|
1492 | - return; |
|
1493 | - } |
|
1489 | + // handle regular products |
|
1490 | + if( $item['product_id'] == $course_product_id ) { |
|
1491 | + Sensei_Utils::user_start_course( $user_id, $course_id ); |
|
1492 | + return; |
|
1493 | + } |
|
1494 | 1494 | |
1495 | - } |
|
1495 | + } |
|
1496 | 1496 | } |
1497 | 1497 | } |
1498 | 1498 | |
@@ -1523,21 +1523,21 @@ discard block |
||
1523 | 1523 | |
1524 | 1524 | //if not posted from the sensei login form let |
1525 | 1525 | // WordPress or any other party handle the failed request |
1526 | - if( ! isset( $_REQUEST['form'] ) || 'sensei-login' != $_REQUEST['form'] ){ |
|
1526 | + if( ! isset( $_REQUEST['form'] ) || 'sensei-login' != $_REQUEST['form'] ){ |
|
1527 | 1527 | |
1528 | - return ; |
|
1528 | + return ; |
|
1529 | 1529 | |
1530 | - } |
|
1530 | + } |
|
1531 | 1531 | |
1532 | - // Get the reffering page, where did the post submission come from? |
|
1533 | - $referrer = add_query_arg('login', false, $_SERVER['HTTP_REFERER']); |
|
1532 | + // Get the reffering page, where did the post submission come from? |
|
1533 | + $referrer = add_query_arg('login', false, $_SERVER['HTTP_REFERER']); |
|
1534 | 1534 | |
1535 | 1535 | // if there's a valid referrer, and it's not the default log-in screen |
1536 | - if(!empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin')){ |
|
1537 | - // let's append some information (login=failed) to the URL for the theme to use |
|
1538 | - wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1539 | - exit; |
|
1540 | - } |
|
1536 | + if(!empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin')){ |
|
1537 | + // let's append some information (login=failed) to the URL for the theme to use |
|
1538 | + wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1539 | + exit; |
|
1540 | + } |
|
1541 | 1541 | }// End sensei_login_fail_redirect_to_front_end_login |
1542 | 1542 | |
1543 | 1543 | /** |
@@ -1548,46 +1548,46 @@ discard block |
||
1548 | 1548 | function sensei_handle_login_request( ) { |
1549 | 1549 | |
1550 | 1550 | // Check that it is a sensei login request and if it has a valid nonce |
1551 | - if( isset( $_REQUEST['form'] ) && 'sensei-login' == $_REQUEST['form'] ) { |
|
1551 | + if( isset( $_REQUEST['form'] ) && 'sensei-login' == $_REQUEST['form'] ) { |
|
1552 | 1552 | |
1553 | - // Validate the login request nonce |
|
1554 | - if( !wp_verify_nonce( $_REQUEST['_wpnonce'], 'sensei-login' ) ){ |
|
1555 | - return; |
|
1556 | - } |
|
1553 | + // Validate the login request nonce |
|
1554 | + if( !wp_verify_nonce( $_REQUEST['_wpnonce'], 'sensei-login' ) ){ |
|
1555 | + return; |
|
1556 | + } |
|
1557 | 1557 | |
1558 | - //get the page where the sensei log form is located |
|
1559 | - $referrer = $_REQUEST['_wp_http_referer']; |
|
1560 | - //$redirect = $_REQUEST['_sensei_redirect']; |
|
1558 | + //get the page where the sensei log form is located |
|
1559 | + $referrer = $_REQUEST['_wp_http_referer']; |
|
1560 | + //$redirect = $_REQUEST['_sensei_redirect']; |
|
1561 | 1561 | |
1562 | - if ( ( isset( $_REQUEST['log'] ) && !empty( $_REQUEST['log'] ) ) |
|
1563 | - && ( isset( $_REQUEST['pwd'] ) && !empty( $_REQUEST['pwd'] ) ) ){ |
|
1562 | + if ( ( isset( $_REQUEST['log'] ) && !empty( $_REQUEST['log'] ) ) |
|
1563 | + && ( isset( $_REQUEST['pwd'] ) && !empty( $_REQUEST['pwd'] ) ) ){ |
|
1564 | 1564 | |
1565 | - // when the user has entered a password or username do the sensei login |
|
1566 | - $creds = array(); |
|
1565 | + // when the user has entered a password or username do the sensei login |
|
1566 | + $creds = array(); |
|
1567 | 1567 | |
1568 | - // check if the requests login is an email address |
|
1569 | - if( is_email( trim( $_REQUEST['log'] ) ) ){ |
|
1570 | - // query wordpress for the users details |
|
1571 | - $user = get_user_by( 'email', sanitize_email( $_REQUEST['log'] ) ); |
|
1568 | + // check if the requests login is an email address |
|
1569 | + if( is_email( trim( $_REQUEST['log'] ) ) ){ |
|
1570 | + // query wordpress for the users details |
|
1571 | + $user = get_user_by( 'email', sanitize_email( $_REQUEST['log'] ) ); |
|
1572 | 1572 | |
1573 | - // validate the user object |
|
1574 | - if( !$user ){ |
|
1573 | + // validate the user object |
|
1574 | + if( !$user ){ |
|
1575 | 1575 | |
1576 | - // the email doesnt exist |
|
1577 | - wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1578 | - exit; |
|
1576 | + // the email doesnt exist |
|
1577 | + wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1578 | + exit; |
|
1579 | 1579 | |
1580 | - } |
|
1580 | + } |
|
1581 | 1581 | |
1582 | - //assigne the username to the creds array for further processing |
|
1583 | - $creds['user_login'] = $user->user_login ; |
|
1582 | + //assigne the username to the creds array for further processing |
|
1583 | + $creds['user_login'] = $user->user_login ; |
|
1584 | 1584 | |
1585 | - }else{ |
|
1585 | + }else{ |
|
1586 | 1586 | |
1587 | - // process this as a default username login |
|
1588 | - $creds['user_login'] = sanitize_text_field( $_REQUEST['log'] ) ; |
|
1587 | + // process this as a default username login |
|
1588 | + $creds['user_login'] = sanitize_text_field( $_REQUEST['log'] ) ; |
|
1589 | 1589 | |
1590 | - } |
|
1590 | + } |
|
1591 | 1591 | |
1592 | 1592 | // get setup the rest of the creds array |
1593 | 1593 | $creds['user_password'] = sanitize_text_field( $_REQUEST['pwd'] ); |
@@ -1597,42 +1597,42 @@ discard block |
||
1597 | 1597 | $user = wp_signon( $creds, false ); |
1598 | 1598 | |
1599 | 1599 | if ( is_wp_error($user) ){ // on login failure |
1600 | - wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1601 | - exit; |
|
1600 | + wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
|
1601 | + exit; |
|
1602 | 1602 | }else{ // on login success |
1603 | 1603 | |
1604 | 1604 | /** |
1605 | - * change the redirect url programatically |
|
1606 | - * |
|
1607 | - * @since 1.6.1 |
|
1608 | - * |
|
1609 | - * @param string $referrer the page where the current url wheresensei login form was posted from |
|
1610 | - */ |
|
1605 | + * change the redirect url programatically |
|
1606 | + * |
|
1607 | + * @since 1.6.1 |
|
1608 | + * |
|
1609 | + * @param string $referrer the page where the current url wheresensei login form was posted from |
|
1610 | + */ |
|
1611 | 1611 | |
1612 | 1612 | $success_redirect_url = apply_filters('sesei_login_success_redirect_url', remove_query_arg( 'login', $referrer ) ); |
1613 | 1613 | |
1614 | 1614 | wp_redirect( esc_url_raw( $success_redirect_url ) ); |
1615 | - exit; |
|
1615 | + exit; |
|
1616 | 1616 | |
1617 | 1617 | } // end is_wp_error($user) |
1618 | 1618 | |
1619 | - }else{ // if username or password is empty |
|
1619 | + }else{ // if username or password is empty |
|
1620 | 1620 | |
1621 | - wp_redirect( esc_url_raw( add_query_arg('login', 'emptyfields', $referrer) ) ); |
|
1622 | - exit; |
|
1621 | + wp_redirect( esc_url_raw( add_query_arg('login', 'emptyfields', $referrer) ) ); |
|
1622 | + exit; |
|
1623 | 1623 | |
1624 | - } // end if username $_REQUEST['log'] and password $_REQUEST['pwd'] is empty |
|
1624 | + } // end if username $_REQUEST['log'] and password $_REQUEST['pwd'] is empty |
|
1625 | 1625 | |
1626 | - }elseif( ( isset( $_GET['login'] ) ) ) { |
|
1627 | - // else if this request is a redircect from a previously faile login request |
|
1628 | - $this->login_message_process(); |
|
1626 | + }elseif( ( isset( $_GET['login'] ) ) ) { |
|
1627 | + // else if this request is a redircect from a previously faile login request |
|
1628 | + $this->login_message_process(); |
|
1629 | 1629 | |
1630 | 1630 | //exit the handle login request function |
1631 | 1631 | return; |
1632 | - } |
|
1632 | + } |
|
1633 | 1633 | |
1634 | - // if none of the above |
|
1635 | - return; |
|
1634 | + // if none of the above |
|
1635 | + return; |
|
1636 | 1636 | |
1637 | 1637 | } // End sensei_login_fail_redirect_to_front_end_login |
1638 | 1638 | |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | */ |
1736 | 1736 | public function login_message_process(){ |
1737 | 1737 | |
1738 | - // setup the message variables |
|
1738 | + // setup the message variables |
|
1739 | 1739 | $message = ''; |
1740 | 1740 | |
1741 | 1741 | //only output message if the url contains login=failed and login=emptyfields |
@@ -1754,22 +1754,22 @@ discard block |
||
1754 | 1754 | }// end login_message_process |
1755 | 1755 | |
1756 | 1756 | |
1757 | - /** |
|
1758 | - * sensei_show_admin_bar(). Use WooCommerce filter |
|
1759 | - * to show admin bar to Teachers as well. |
|
1760 | - * |
|
1761 | - * @return void redirect |
|
1762 | - * |
|
1763 | - */ |
|
1764 | - public function sensei_show_admin_bar () { |
|
1757 | + /** |
|
1758 | + * sensei_show_admin_bar(). Use WooCommerce filter |
|
1759 | + * to show admin bar to Teachers as well. |
|
1760 | + * |
|
1761 | + * @return void redirect |
|
1762 | + * |
|
1763 | + */ |
|
1764 | + public function sensei_show_admin_bar () { |
|
1765 | 1765 | |
1766 | - if (current_user_can('edit_courses')) { |
|
1766 | + if (current_user_can('edit_courses')) { |
|
1767 | 1767 | |
1768 | - add_filter( 'woocommerce_disable_admin_bar', '__return_false', 10, 1); |
|
1768 | + add_filter( 'woocommerce_disable_admin_bar', '__return_false', 10, 1); |
|
1769 | 1769 | |
1770 | - } |
|
1770 | + } |
|
1771 | 1771 | |
1772 | - } |
|
1772 | + } |
|
1773 | 1773 | |
1774 | 1774 | } // End Class |
1775 | 1775 |