Completed
Push — master ( 201c1b...d51ce1 )
by Dwain
04:57
created
includes/lib/woo-functions.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,9 @@  discard block
 block discarded – undo
7 7
 	function woothemes_queue_update( $file, $file_id, $product_id ) {
8 8
 		global $woothemes_queued_updates;
9 9
 
10
-		if ( ! isset( $woothemes_queued_updates ) )
11
-			$woothemes_queued_updates = array();
10
+		if ( ! isset( $woothemes_queued_updates ) ) {
11
+					$woothemes_queued_updates = array();
12
+		}
12 13
 
13 14
 		$plugin             = new stdClass();
14 15
 		$plugin->file       = $file;
@@ -31,7 +32,9 @@  discard block
 block discarded – undo
31 32
 			false !== $api ||
32 33
 			! isset( $args->slug ) ||
33 34
 			'woothemes-updater' != $args->slug
34
-		) return $api;
35
+		) {
36
+			return $api;
37
+		}
35 38
 
36 39
 		$api = new stdClass();
37 40
 		$api->name = 'WooThemes Updater';
@@ -54,7 +57,9 @@  discard block
 block discarded – undo
54 57
 	 */
55 58
 	function woothemes_updater_notice() {
56 59
 		$active_plugins = apply_filters( 'active_plugins', get_option('active_plugins' ) );
57
-		if ( in_array( 'woothemes-updater/woothemes-updater.php', $active_plugins ) ) return;
60
+		if ( in_array( 'woothemes-updater/woothemes-updater.php', $active_plugins ) ) {
61
+			return;
62
+		}
58 63
 
59 64
 		$slug = 'woothemes-updater';
60 65
 		$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
Please login to merge, or discard this patch.
includes/class-sensei-analysis-lesson-list-table.php 1 patch
Braces   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Analysis Lesson List Table Class
@@ -204,31 +207,26 @@  discard block
 block discarded – undo
204 207
 			$status_class = 'graded';
205 208
 
206 209
 			$grade =  __( 'No Grade', 'woothemes-sensei' );
207
-		}
208
-		elseif( 'graded' == $item->comment_approved ) {
210
+		} elseif( 'graded' == $item->comment_approved ) {
209 211
 			$status = __( 'Graded', 'woothemes-sensei' ) ;
210 212
 			$status_class = 'graded';
211 213
 
212 214
 			$grade = get_comment_meta( $item->comment_ID, 'grade', true);
213
-		}
214
-		elseif( 'passed' == $item->comment_approved ) {
215
+		} elseif( 'passed' == $item->comment_approved ) {
215 216
 			$status =  __( 'Passed', 'woothemes-sensei' );
216 217
 			$status_class = 'graded';
217 218
 
218 219
 			$grade = get_comment_meta( $item->comment_ID, 'grade', true);
219
-		}
220
-		elseif( 'failed' == $item->comment_approved ) {
220
+		} elseif( 'failed' == $item->comment_approved ) {
221 221
 			$status = __( 'Failed', 'woothemes-sensei' );
222 222
 			$status_class = 'failed';
223 223
 
224 224
 			$grade = get_comment_meta( $item->comment_ID, 'grade', true);
225
-		}
226
-		elseif( 'ungraded' == $item->comment_approved ) {
225
+		} elseif( 'ungraded' == $item->comment_approved ) {
227 226
 			$status =  __( 'Ungraded', 'woothemes-sensei' );
228 227
 			$status_class = 'ungraded';
229 228
 
230
-		}
231
-		else {
229
+		} else {
232 230
 			$status =  __( 'In Progress', 'woothemes-sensei' );
233 231
 			$user_end_date = '';
234 232
 		}
Please login to merge, or discard this patch.
includes/class-sensei-question.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Question Class
@@ -211,7 +214,9 @@  discard block
 block discarded – undo
211 214
 
212 215
 			$lesson_id = get_post_meta( $quiz, '_quiz_lesson', true );
213 216
 
214
-			if( ! $lesson_id ) continue;
217
+			if( ! $lesson_id ) {
218
+				continue;
219
+			}
215 220
 
216 221
 			$lessons[ $lesson_id ]['title'] = get_the_title( $lesson_id );
217 222
 			$lessons[ $lesson_id ]['link'] = admin_url( 'post.php?post=' . $lesson_id . '&action=edit' );
@@ -880,7 +885,7 @@  discard block
 block discarded – undo
880 885
 
881 886
                 $merged_options = array_merge( $question_data[ 'question_wrong_answers' ], $question_data[ 'question_right_answer' ] );
882 887
 
883
-            }  else {
888
+            } else {
884 889
 
885 890
                 array_push( $question_data[ 'question_wrong_answers' ], $question_data[ 'question_right_answer' ] );
886 891
                 $merged_options = $question_data[ 'question_wrong_answers' ];
@@ -908,7 +913,7 @@  discard block
 block discarded – undo
908 913
 
909 914
                         $user_correct = true;
910 915
 
911
-                    }  else if( $question_data[ 'user_question_grade' ] > 0 ) {
916
+                    } else if( $question_data[ 'user_question_grade' ] > 0 ) {
912 917
 
913 918
                         $user_correct = true;
914 919
 
@@ -923,7 +928,7 @@  discard block
 block discarded – undo
923 928
 
924 929
                         $answer_class .= ' right_answer';
925 930
 
926
-                    }  elseif( !is_array($question_data['question_right_answer']) && $question_data['question_right_answer'] == $answer ) {
931
+                    } elseif( !is_array($question_data['question_right_answer']) && $question_data['question_right_answer'] == $answer ) {
927 932
 
928 933
                         $answer_class .= ' right_answer';
929 934
 
@@ -1006,13 +1011,13 @@  discard block
 block discarded – undo
1006 1011
                             }
1007 1012
                         }
1008 1013
 
1009
-                    }else{
1014
+                    } else{
1010 1015
 
1011 1016
                         $answer_options_sorted = $question_answers_options;
1012 1017
 
1013 1018
                     }
1014 1019
 
1015
-                }else{
1020
+                } else{
1016 1021
 
1017 1022
                     $answer_options_sorted = $question_answers_options;
1018 1023
 
@@ -1075,12 +1080,12 @@  discard block
 block discarded – undo
1075 1080
 
1076 1081
             $right_answer = ucfirst($right_answer);
1077 1082
 
1078
-        }elseif( 'multiple-choice' == $type ) {
1083
+        } elseif( 'multiple-choice' == $type ) {
1079 1084
 
1080 1085
             $right_answer = (array) $right_answer;
1081 1086
             $right_answer = implode( ', ', $right_answer );
1082 1087
 
1083
-        }elseif( 'gap-fill' == $type ) {
1088
+        } elseif( 'gap-fill' == $type ) {
1084 1089
 
1085 1090
             $right_answer_array = explode( '||', $right_answer );
1086 1091
             if ( isset( $right_answer_array[0] ) ) { $gapfill_pre = $right_answer_array[0]; } else { $gapfill_pre = ''; }
@@ -1089,7 +1094,7 @@  discard block
 block discarded – undo
1089 1094
 
1090 1095
             $right_answer = $gapfill_pre . ' <span class="highlight">' . $gapfill_gap . '</span> ' . $gapfill_post;
1091 1096
 
1092
-        }else{
1097
+        } else{
1093 1098
 
1094 1099
             // for non auto gradable question types no answer should be returned.
1095 1100
             $right_answer = '';
Please login to merge, or discard this patch.
includes/class-sensei-course.php 1 patch
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Course Class
@@ -614,7 +617,7 @@  discard block
 block discarded – undo
614 617
 
615 618
 			return $results_array;
616 619
 
617
-		}else{
620
+		} else{
618 621
 
619 622
 			//reset the pagination as this widgets do not need it
620 623
 			$post_args['paged'] = 1;
@@ -835,7 +838,7 @@  discard block
 block discarded – undo
835 838
 
836 839
             return $html;
837 840
 
838
-        }else{
841
+        } else{
839 842
 
840 843
             echo $html;
841 844
 
@@ -982,8 +985,7 @@  discard block
 block discarded – undo
982 985
 				$has_questions = get_post_meta( $lesson_id, '_quiz_has_questions', true );
983 986
 				if ( $has_questions && $boolean_check ) {
984 987
 					return true;
985
-				}
986
-				elseif ( $has_questions ) {
988
+				} elseif ( $has_questions ) {
987 989
 					$quiz_id = Sensei()->lesson->lesson_quizzes( $lesson_id );
988 990
 //					$questions = Sensei()->lesson->lesson_quiz_questions( $quiz_id );
989 991
 //					if( count( $questions ) > 0 ) {
@@ -1805,11 +1807,11 @@  discard block
 block discarded – undo
1805 1807
 
1806 1808
             $course_id = $email['course_id'];
1807 1809
 
1808
-        }elseif( isset( $email['lesson_id'] ) ){
1810
+        } elseif( isset( $email['lesson_id'] ) ){
1809 1811
 
1810 1812
             $course_id = Sensei()->lesson->get_course_id( $email['lesson_id'] );
1811 1813
 
1812
-        }elseif( isset( $email['quiz_id'] ) ){
1814
+        } elseif( isset( $email['quiz_id'] ) ){
1813 1815
 
1814 1816
             $lesson_id = Sensei()->quiz->get_lesson_id( $email['quiz_id'] );
1815 1817
             $course_id = Sensei()->lesson->get_course_id( $lesson_id );
@@ -1870,7 +1872,7 @@  discard block
 block discarded – undo
1870 1872
 
1871 1873
         if( isset( $_POST['disable_sensei_course_notification'] ) && 'on'== $_POST['disable_sensei_course_notification']  ) {
1872 1874
             $new_val = true;
1873
-        }else{
1875
+        } else{
1874 1876
             $new_val = false;
1875 1877
         }
1876 1878
 
@@ -2009,7 +2011,7 @@  discard block
 block discarded – undo
2009 2011
 
2010 2012
                 $classes[] = 'user-status-completed';
2011 2013
 
2012
-            }else{
2014
+            } else{
2013 2015
 
2014 2016
                 $classes[] = 'user-status-active';
2015 2017
 
@@ -2826,7 +2828,7 @@  discard block
 block discarded – undo
2826 2828
 
2827 2829
             $title = $term->name;
2828 2830
 
2829
-        }else{
2831
+        } else{
2830 2832
 
2831 2833
             $title = 'Course Category';
2832 2834
 
Please login to merge, or discard this patch.
includes/class-sensei-templates.php 1 patch
Braces   +21 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // security check, don't load file outside WP
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// security check, don't load file outside WP
3 6
 /**
4 7
  * Sensei Template Class
5 8
  *
@@ -69,8 +72,9 @@  discard block
 block discarded – undo
69 72
      */
70 73
     public static function get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
71 74
 
72
-        if ( $args && is_array($args) )
73
-            extract( $args );
75
+        if ( $args && is_array($args) ) {
76
+                    extract( $args );
77
+        }
74 78
 
75 79
         $located = self::locate_template( $template_name, $template_path, $default_path );
76 80
 
@@ -99,8 +103,12 @@  discard block
 block discarded – undo
99 103
      */
100 104
     public static function locate_template( $template_name, $template_path = '', $default_path = '' ) {
101 105
 
102
-        if ( ! $template_path ) $template_path = Sensei()->template_url;
103
-        if ( ! $default_path ) $default_path = Sensei()->plugin_path() . '/templates/';
106
+        if ( ! $template_path ) {
107
+        	$template_path = Sensei()->template_url;
108
+        }
109
+        if ( ! $default_path ) {
110
+        	$default_path = Sensei()->plugin_path() . '/templates/';
111
+        }
104 112
 
105 113
         // Look within passed path within the theme - this is priority
106 114
         $template = locate_template(
@@ -261,7 +269,7 @@  discard block
 block discarded – undo
261 269
             $find[] = $file;
262 270
             $find[] = Sensei()->template_url . $file;
263 271
 
264
-        }elseif( is_author()
272
+        } elseif( is_author()
265 273
                  && Sensei_Teacher::is_a_teacher( get_query_var('author') )
266 274
                  && ! user_can( get_query_var('author'), 'manage_options' ) ){
267 275
 
@@ -274,7 +282,9 @@  discard block
 block discarded – undo
274 282
         if ( $file ) {
275 283
 
276 284
             $template = locate_template( $find );
277
-            if ( ! $template ) $template = Sensei()->plugin_path() . '/templates/' . $file;
285
+            if ( ! $template ) {
286
+            	$template = Sensei()->plugin_path() . '/templates/' . $file;
287
+            }
278 288
 
279 289
         } // End If Statement
280 290
 
@@ -305,7 +315,9 @@  discard block
 block discarded – undo
305 315
         $find[] = Sensei()->template_url . $file;
306 316
 
307 317
         $template = locate_template( $find );
308
-        if ( ! $template ) $template = Sensei()->plugin_path() . '/templates/' . $file;
318
+        if ( ! $template ) {
319
+        	$template = Sensei()->plugin_path() . '/templates/' . $file;
320
+        }
309 321
 
310 322
         return $template;
311 323
 
@@ -335,7 +347,7 @@  discard block
 block discarded – undo
335 347
                 include( $found_template );
336 348
                 get_sensei_footer();
337 349
 
338
-            }else{
350
+            } else{
339 351
 
340 352
                 include( $found_template );
341 353
 
Please login to merge, or discard this patch.
includes/class-sensei-messages.php 1 patch
Braces   +39 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Messages Class
@@ -73,7 +76,9 @@  discard block
 block discarded – undo
73 76
 
74 77
 	public function add_meta_box( $post_type, $post ) {
75 78
 
76
-		if( ! $post_type == $this->post_type ) return;
79
+		if( ! $post_type == $this->post_type ) {
80
+			return;
81
+		}
77 82
 
78 83
 		add_meta_box( $this->post_type . '-data', __( 'Message Information', 'woothemes-sensei' ), array( $this, 'meta_box_content' ), $this->post_type, 'normal', 'default' );
79 84
 
@@ -138,7 +143,9 @@  discard block
 block discarded – undo
138 143
 	public function save_message( $post_id = 0 ) {
139 144
 		global $post;
140 145
 
141
-		if( $this->post_type != get_post_type() ) return;
146
+		if( $this->post_type != get_post_type() ) {
147
+			return;
148
+		}
142 149
 
143 150
 		if( isset( $_POST['sender'] ) && $_POST['sender'] ) {
144 151
 			update_post_meta( $post_id, '_sender', $_POST['sender'] );
@@ -174,7 +181,9 @@  discard block
 block discarded – undo
174 181
 
175 182
 		if( ! isset( Sensei()->settings->settings['messages_disable'] ) || ! Sensei()->settings->settings['messages_disable'] ) {
176 183
 
177
-			if( ! is_user_logged_in() ) return;
184
+			if( ! is_user_logged_in() ) {
185
+				return;
186
+			}
178 187
 
179 188
 			if( isset( $_GET['contact'] ) ) {
180 189
 				$html .= $this->teacher_contact_form( $post );
@@ -185,7 +194,7 @@  discard block
 block discarded – undo
185 194
 					$contact_button_text = __( 'Contact Lesson Teacher', 'woothemes-sensei' );
186 195
 				} elseif( 'course' == $post->post_type ) {
187 196
 					$contact_button_text = __( 'Contact Course Teacher', 'woothemes-sensei' );
188
-				}else{
197
+				} else{
189 198
                     $contact_button_text = __( 'Contact Teacher', 'woothemes-sensei' );
190 199
                 }
191 200
 
@@ -203,14 +212,18 @@  discard block
 block discarded – undo
203 212
 
204 213
 	public function teacher_contact_form( $post ) {
205 214
 
206
-		if( ! is_user_logged_in() ) return;
215
+		if( ! is_user_logged_in() ) {
216
+			return;
217
+		}
207 218
 
208 219
 		global $current_user;
209 220
 		wp_get_current_user();
210 221
 
211 222
 		$html = '';
212 223
 
213
-		if( ! isset( $post->ID ) ) return $html;
224
+		if( ! isset( $post->ID ) ) {
225
+			return $html;
226
+		}
214 227
 
215 228
         //confirm private message
216 229
         $confirmation = '';
@@ -244,9 +257,13 @@  discard block
 block discarded – undo
244 257
 
245 258
 	public function save_new_message() {
246 259
 
247
-		if( ! isset( $_POST['sensei_message_teacher_nonce'] ) ) return;
260
+		if( ! isset( $_POST['sensei_message_teacher_nonce'] ) ) {
261
+			return;
262
+		}
248 263
 
249
-		if( ! wp_verify_nonce( $_POST['sensei_message_teacher_nonce'], 'message_teacher' ) ) return;
264
+		if( ! wp_verify_nonce( $_POST['sensei_message_teacher_nonce'], 'message_teacher' ) ) {
265
+			return;
266
+		}
250 267
 
251 268
 		$message_id = $this->save_new_message_post( $_POST['sender_id'], $_POST['receiver_id'], $_POST['contact_message'], $_POST['post_id'] );
252 269
 
@@ -257,12 +274,16 @@  discard block
 block discarded – undo
257 274
 		// Get comment object
258 275
     	$comment = get_comment( $comment_id );
259 276
 
260
-		if( is_null( $comment ) ) return;
277
+		if( is_null( $comment ) ) {
278
+			return;
279
+		}
261 280
 
262 281
 		// Get message post object
263 282
 		$message = get_post( $comment->comment_post_ID );
264 283
 
265
-		if( $message->post_type != $this->post_type ) return;
284
+		if( $message->post_type != $this->post_type ) {
285
+			return;
286
+		}
266 287
 
267 288
 		// Force comment to be approved
268 289
 		wp_set_comment_status( $comment_id, 'approve' );
@@ -360,7 +381,9 @@  discard block
 block discarded – undo
360 381
 	 */
361 382
 	private function view_message( $message_id, $user_id = 0) {
362 383
 
363
-		if( ! is_user_logged_in() ) return false;
384
+		if( ! is_user_logged_in() ) {
385
+			return false;
386
+		}
364 387
 
365 388
 		if( $user_id == 0 ) {
366 389
 			global $current_user;
@@ -424,9 +447,7 @@  discard block
 block discarded – undo
424 447
 
425 448
                 wp_redirect($my_courses_url, 303);
426 449
                 exit;
427
-            }
428
-
429
-            else {
450
+            } else {
430 451
 
431 452
                 wp_redirect(home_url('/wp-login.php'), 303);
432 453
                 exit;
@@ -442,7 +463,9 @@  discard block
 block discarded – undo
442 463
 	public function message_list( $query ) {
443 464
 		global $current_user;
444 465
 
445
-		if( is_admin() ) return;
466
+		if( is_admin() ) {
467
+			return;
468
+		}
446 469
 
447 470
 		if( is_post_type_archive( $this->post_type ) && $query->is_main_query() ) {
448 471
 			wp_get_current_user();
Please login to merge, or discard this patch.
includes/class-sensei-learners-main.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Learners Overview List Table Class
@@ -409,8 +412,7 @@  discard block
 block discarded – undo
409 412
 		if( $this->lesson_id ) {
410 413
 			$post_id = intval( $this->lesson_id );
411 414
 			$activity = 'sensei_lesson_status';
412
-		}
413
-		elseif( $this->course_id ) {
415
+		} elseif( $this->course_id ) {
414 416
 			$post_id = intval( $this->course_id );
415 417
 			$activity = 'sensei_course_status';
416 418
 		}
@@ -601,8 +603,7 @@  discard block
 block discarded – undo
601 603
 			$post_type = __( 'Course', 'woothemes-sensei' );
602 604
 			$form_post_type = 'course';
603 605
 			$form_course_id = $this->course_id;
604
-		}
605
-		elseif( $this->course_id && $this->lesson_id ) {
606
+		} elseif( $this->course_id && $this->lesson_id ) {
606 607
 			$post_title = get_the_title( $this->lesson_id );
607 608
 			$post_type = __( 'Lesson', 'woothemes-sensei' );
608 609
 			$form_post_type = 'lesson';
Please login to merge, or discard this patch.
includes/class-sensei-list-table.php 1 patch
Braces   +16 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Generic List Table Class
@@ -131,8 +134,9 @@  discard block
 block discarded – undo
131 134
 	 * @return array
132 135
 	 */
133 136
 	function get_column_info() {
134
-		if ( isset( $this->_column_headers ) )
135
-			return $this->_column_headers;
137
+		if ( isset( $this->_column_headers ) ) {
138
+					return $this->_column_headers;
139
+		}
136 140
 
137 141
 		$columns = $this->get_columns();
138 142
 		$hidden = get_hidden_columns( $this->screen );
@@ -152,12 +156,14 @@  discard block
 block discarded – undo
152 156
 
153 157
 		$sortable = array();
154 158
 		foreach ( $_sortable as $id => $data ) {
155
-			if ( empty( $data ) )
156
-				continue;
159
+			if ( empty( $data ) ) {
160
+							continue;
161
+			}
157 162
 
158 163
 			$data = (array) $data;
159
-			if ( !isset( $data[1] ) )
160
-				$data[1] = false;
164
+			if ( !isset( $data[1] ) ) {
165
+							$data[1] = false;
166
+			}
161 167
 
162 168
 			$sortable[$id] = $data;
163 169
 		}
@@ -188,8 +194,9 @@  discard block
 block discarded – undo
188 194
 			$class = "class='$column_name column-$column_name'";
189 195
 
190 196
 			$style = '';
191
-			if ( in_array( $column_name, $hidden ) )
192
-				$style = ' style="display:none;"';
197
+			if ( in_array( $column_name, $hidden ) ) {
198
+							$style = ' style="display:none;"';
199
+			}
193 200
 
194 201
 			$attributes = "$class$style";
195 202
 
Please login to merge, or discard this patch.
includes/class-sensei-analysis-course-list-table.php 1 patch
Braces   +12 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Analysis Course List Table Class
@@ -359,31 +362,26 @@  discard block
 block discarded – undo
359 362
 							$status_class = 'graded';
360 363
 
361 364
 							$grade = __( 'No Grade', 'woothemes-sensei' );
362
-						}
363
-						elseif( 'graded' == $lesson_status->comment_approved ) {
365
+						} elseif( 'graded' == $lesson_status->comment_approved ) {
364 366
 							$status =  __( 'Graded', 'woothemes-sensei' );
365 367
 							$status_class = 'graded';
366 368
 
367 369
 							$grade = get_comment_meta( $lesson_status->comment_ID, 'grade', true);
368
-						}
369
-						elseif( 'passed' == $lesson_status->comment_approved ) {
370
+						} elseif( 'passed' == $lesson_status->comment_approved ) {
370 371
 							$status =  __( 'Passed', 'woothemes-sensei' );
371 372
 							$status_class = 'graded';
372 373
 
373 374
 							$grade = get_comment_meta( $lesson_status->comment_ID, 'grade', true);
374
-						}
375
-						elseif( 'failed' == $lesson_status->comment_approved ) {
375
+						} elseif( 'failed' == $lesson_status->comment_approved ) {
376 376
 							$status =  __( 'Failed', 'woothemes-sensei' );
377 377
 							$status_class = 'failed';
378 378
 
379 379
 							$grade = get_comment_meta( $lesson_status->comment_ID, 'grade', true);
380
-						}
381
-						elseif( 'ungraded' == $lesson_status->comment_approved ) {
380
+						} elseif( 'ungraded' == $lesson_status->comment_approved ) {
382 381
 							$status =  __( 'Ungraded', 'woothemes-sensei' );
383 382
 							$status_class = 'ungraded';
384 383
 
385
-						}
386
-						elseif( 'in-progress' == $lesson_status->comment_approved ) {
384
+						} elseif( 'in-progress' == $lesson_status->comment_approved ) {
387 385
 							$status =  __( 'In Progress', 'woothemes-sensei' );
388 386
 							$user_end_date = '';
389 387
 						}
@@ -392,8 +390,7 @@  discard block
 block discarded – undo
392 390
 					// Output users data
393 391
 					if ( $this->csv_output ) {
394 392
 						$lesson_title = apply_filters( 'the_title', $item->post_title, $item->ID );
395
-					}
396
-					else {
393
+					} else {
397 394
 						$url = add_query_arg( array( 'page' => $this->page_slug, 'lesson_id' => $item->ID ), admin_url( 'admin.php' ) );
398 395
 						$lesson_title = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . apply_filters( 'the_title', $item->post_title, $item->ID ) . '</a></strong>';
399 396
 
@@ -448,8 +445,7 @@  discard block
 block discarded – undo
448 445
 					// Output lesson data
449 446
 					if ( $this->csv_output ) {
450 447
 						$lesson_title = apply_filters( 'the_title', $item->post_title, $item->ID );
451
-					}
452
-					else {
448
+					} else {
453 449
 						$url = add_query_arg( array( 'page' => $this->page_slug, 'lesson_id' => $item->ID ), admin_url( 'admin.php' ) );
454 450
 						$lesson_title = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . apply_filters( 'the_title', $item->post_title, $item->ID ) . '</a></strong>';
455 451
 
@@ -582,8 +578,7 @@  discard block
 block discarded – undo
582 578
 	public function data_table_header() {
583 579
 		if ( $this->user_id ) {
584 580
 			$learners_text = __( 'Other Learners taking this Course', 'woothemes-sensei' );
585
-		}
586
-		else {
581
+		} else {
587 582
 			$learners_text = __( 'Learners taking this Course', 'woothemes-sensei' );
588 583
 		}
589 584
 		$lessons_text = __( 'Lessons in this Course', 'woothemes-sensei' );
Please login to merge, or discard this patch.