@@ -1,5 +1,8 @@ discard block |
||
| 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 Utilities Class |
@@ -181,8 +184,7 @@ discard block |
||
| 181 | 184 | // ...use a filter to switch the encoding back |
| 182 | 185 | add_filter( 'comments_clauses', array( __CLASS__, 'comment_multiple_status_filter' ) ); |
| 183 | 186 | } |
| 184 | - } |
|
| 185 | - else { |
|
| 187 | + } else { |
|
| 186 | 188 | $args['status'] = 'any'; // 'log' == 'sensei_user_answer' |
| 187 | 189 | } |
| 188 | 190 | |
@@ -307,8 +309,12 @@ discard block |
||
| 307 | 309 | } |
| 308 | 310 | |
| 309 | 311 | foreach( $activities as $activity ) { |
| 310 | - if( '' == $activity->comment_type ) continue; |
|
| 311 | - if( strpos( 'sensei_', $activity->comment_type ) != 0 ) continue; |
|
| 312 | + if( '' == $activity->comment_type ) { |
|
| 313 | + continue; |
|
| 314 | + } |
|
| 315 | + if( strpos( 'sensei_', $activity->comment_type ) != 0 ) { |
|
| 316 | + continue; |
|
| 317 | + } |
|
| 312 | 318 | $dataset_changes = wp_delete_comment( intval( $activity->comment_ID ), true ); |
| 313 | 319 | wp_cache_flush(); |
| 314 | 320 | } |
@@ -360,11 +366,13 @@ discard block |
||
| 360 | 366 | $emails[] = $user->user_email; |
| 361 | 367 | } |
| 362 | 368 | |
| 363 | - if ( is_email( $customer_email ) ) |
|
| 364 | - $emails[] = $customer_email; |
|
| 369 | + if ( is_email( $customer_email ) ) { |
|
| 370 | + $emails[] = $customer_email; |
|
| 371 | + } |
|
| 365 | 372 | |
| 366 | - if ( sizeof( $emails ) == 0 ) |
|
| 367 | - return false; |
|
| 373 | + if ( sizeof( $emails ) == 0 ) { |
|
| 374 | + return false; |
|
| 375 | + } |
|
| 368 | 376 | |
| 369 | 377 | return Sensei_WC::has_customer_bought_product( $user_id, $product_id ); |
| 370 | 378 | |
@@ -379,7 +387,9 @@ discard block |
||
| 379 | 387 | */ |
| 380 | 388 | public static function sensei_text_editor( $content = '', $editor_id = 'senseitexteditor', $input_name = '' ) { |
| 381 | 389 | |
| 382 | - if( ! $input_name ) $input_name = $editor_id; |
|
| 390 | + if( ! $input_name ) { |
|
| 391 | + $input_name = $editor_id; |
|
| 392 | + } |
|
| 383 | 393 | |
| 384 | 394 | $buttons = 'bold,italic,underline,strikethrough,blockquote,bullist,numlist,justifyleft,justifycenter,justifyright,undo,redo,pastetext'; |
| 385 | 395 | |
@@ -689,8 +699,7 @@ discard block |
||
| 689 | 699 | if ( $has_questions ) { |
| 690 | 700 | $status = 'passed'; // Force a pass |
| 691 | 701 | $metadata['grade'] = 0; |
| 692 | - } |
|
| 693 | - else { |
|
| 702 | + } else { |
|
| 694 | 703 | $status = 'complete'; |
| 695 | 704 | } |
| 696 | 705 | } |
@@ -738,7 +747,9 @@ discard block |
||
| 738 | 747 | public static function sensei_remove_user_from_lesson( $lesson_id = 0, $user_id = 0, $from_course = false ) { |
| 739 | 748 | |
| 740 | 749 | |
| 741 | - if( ! $lesson_id ) return false; |
|
| 750 | + if( ! $lesson_id ) { |
|
| 751 | + return false; |
|
| 752 | + } |
|
| 742 | 753 | |
| 743 | 754 | if( intval( $user_id ) == 0 ) { |
| 744 | 755 | $user_id = get_current_user_id(); |
@@ -776,7 +787,9 @@ discard block |
||
| 776 | 787 | public static function sensei_remove_user_from_course( $course_id = 0, $user_id = 0 ) { |
| 777 | 788 | |
| 778 | 789 | |
| 779 | - if( ! $course_id ) return false; |
|
| 790 | + if( ! $course_id ) { |
|
| 791 | + return false; |
|
| 792 | + } |
|
| 780 | 793 | |
| 781 | 794 | if( intval( $user_id ) == 0 ) { |
| 782 | 795 | $user_id = get_current_user_id(); |
@@ -844,8 +857,7 @@ discard block |
||
| 844 | 857 | if( $question ) { |
| 845 | 858 | if ( is_object( $question ) ) { |
| 846 | 859 | $user_answer_id = $question->comment_ID; |
| 847 | - } |
|
| 848 | - else { |
|
| 860 | + } else { |
|
| 849 | 861 | if( intval( $user_id ) == 0 ) { |
| 850 | 862 | $user_id = get_current_user_id(); |
| 851 | 863 | } |
@@ -872,8 +884,7 @@ discard block |
||
| 872 | 884 | if( $question ) { |
| 873 | 885 | if ( is_object( $question ) ) { |
| 874 | 886 | $user_answer_id = $question->comment_ID; |
| 875 | - } |
|
| 876 | - else { |
|
| 887 | + } else { |
|
| 877 | 888 | if( intval( $user_id ) == 0 ) { |
| 878 | 889 | $user_id = get_current_user_id(); |
| 879 | 890 | } |
@@ -938,8 +949,7 @@ discard block |
||
| 938 | 949 | if ( !empty($notes) ) { |
| 939 | 950 | $user_lesson_id = WooThemes_Sensei_Utils::sensei_get_activity_value( array( 'post_id' => $question_id, 'user_id' => $user_id, 'type' => 'sensei_user_answer', 'field' => 'comment_ID' ) ); |
| 940 | 951 | $activity_logged = update_comment_meta( $user_lesson_id, 'answer_note', $notes ); |
| 941 | - } |
|
| 942 | - else { |
|
| 952 | + } else { |
|
| 943 | 953 | $activity_logged = true; |
| 944 | 954 | } |
| 945 | 955 | } |
@@ -1451,8 +1461,7 @@ discard block |
||
| 1451 | 1461 | $lessons_completed++; |
| 1452 | 1462 | break; |
| 1453 | 1463 | } |
| 1454 | - } |
|
| 1455 | - else { |
|
| 1464 | + } else { |
|
| 1456 | 1465 | switch ( $lesson_status->comment_approved ) { |
| 1457 | 1466 | case 'complete': // Lesson has no quiz/questions |
| 1458 | 1467 | case 'graded': // Lesson has quiz, but it's not important what the grade was |
@@ -1500,11 +1509,9 @@ discard block |
||
| 1500 | 1509 | if( $course ) { |
| 1501 | 1510 | if ( is_object( $course ) && is_a( $course,'WP_Comment') ) { |
| 1502 | 1511 | $user_course_status = $course->comment_approved; |
| 1503 | - } |
|
| 1504 | - elseif ( !is_numeric( $course ) && ! is_a( $course,'WP_Post') ) { |
|
| 1512 | + } elseif ( !is_numeric( $course ) && ! is_a( $course,'WP_Post') ) { |
|
| 1505 | 1513 | $user_course_status = $course; |
| 1506 | - } |
|
| 1507 | - else { |
|
| 1514 | + } else { |
|
| 1508 | 1515 | if( ! $user_id ) { |
| 1509 | 1516 | $user_id = get_current_user_id(); |
| 1510 | 1517 | } |
@@ -1564,11 +1571,9 @@ discard block |
||
| 1564 | 1571 | if ( is_object( $lesson ) ) { |
| 1565 | 1572 | $user_lesson_status = $lesson->comment_approved; |
| 1566 | 1573 | $lesson_id = $lesson->comment_post_ID; |
| 1567 | - } |
|
| 1568 | - elseif ( ! is_numeric( $lesson ) ) { |
|
| 1574 | + } elseif ( ! is_numeric( $lesson ) ) { |
|
| 1569 | 1575 | $user_lesson_status = $lesson; |
| 1570 | - } |
|
| 1571 | - else { |
|
| 1576 | + } else { |
|
| 1572 | 1577 | if( ! $user_id ) { |
| 1573 | 1578 | $user_id = get_current_user_id(); |
| 1574 | 1579 | } |
@@ -1581,8 +1586,7 @@ discard block |
||
| 1581 | 1586 | |
| 1582 | 1587 | if ( $_user_lesson_status ) { |
| 1583 | 1588 | $user_lesson_status = $_user_lesson_status->comment_approved; |
| 1584 | - } |
|
| 1585 | - else { |
|
| 1589 | + } else { |
|
| 1586 | 1590 | return false; // No status means not complete |
| 1587 | 1591 | } |
| 1588 | 1592 | $lesson_id = $lesson; |
@@ -1683,7 +1687,9 @@ discard block |
||
| 1683 | 1687 | |
| 1684 | 1688 | public static function user_passed_quiz( $quiz_id = 0, $user_id = 0 ) { |
| 1685 | 1689 | |
| 1686 | - if( ! $quiz_id ) return false; |
|
| 1690 | + if( ! $quiz_id ) { |
|
| 1691 | + return false; |
|
| 1692 | + } |
|
| 1687 | 1693 | |
| 1688 | 1694 | if( ! $user_id ) { |
| 1689 | 1695 | $user_id = get_current_user_id(); |
@@ -1921,7 +1927,7 @@ discard block |
||
| 1921 | 1927 | $start_function = 'user_start_'.$post_type; |
| 1922 | 1928 | $sensei_user_activity_id = self::$start_function( $user_id, $post_id ); |
| 1923 | 1929 | |
| 1924 | - }else{ |
|
| 1930 | + } else{ |
|
| 1925 | 1931 | |
| 1926 | 1932 | $sensei_user_activity_id = $sensei_user_status->comment_ID; |
| 1927 | 1933 | |
@@ -2138,7 +2144,7 @@ discard block |
||
| 2138 | 2144 | |
| 2139 | 2145 | return round( $val, $precision, $mode ); |
| 2140 | 2146 | |
| 2141 | - }else{ |
|
| 2147 | + } else{ |
|
| 2142 | 2148 | |
| 2143 | 2149 | return round( $val, $precision ); |
| 2144 | 2150 | |
@@ -181,7 +181,9 @@ discard block |
||
| 181 | 181 | * @return void |
| 182 | 182 | */ |
| 183 | 183 | function sensei_recent_comments_widget_filter( $widget_args = array() ) { |
| 184 | - if ( ! isset( $widget_args['post_type'] ) ) $widget_args['post_type'] = array( 'post', 'page' ); |
|
| 184 | + if ( ! isset( $widget_args['post_type'] ) ) { |
|
| 185 | + $widget_args['post_type'] = array( 'post', 'page' ); |
|
| 186 | + } |
|
| 185 | 187 | return $widget_args; |
| 186 | 188 | } // End sensei_recent_comments_widget_filter() |
| 187 | 189 | add_filter( 'widget_comments_args', 'sensei_recent_comments_widget_filter', 10, 1 ); |
@@ -196,8 +198,9 @@ discard block |
||
| 196 | 198 | function sensei_course_archive_filter( $query ) { |
| 197 | 199 | |
| 198 | 200 | |
| 199 | - if ( ! $query->is_main_query() ) |
|
| 200 | - return; |
|
| 201 | + if ( ! $query->is_main_query() ) { |
|
| 202 | + return; |
|
| 203 | + } |
|
| 201 | 204 | |
| 202 | 205 | // Apply Filter only if on frontend and when course archive is running |
| 203 | 206 | $course_page_id = intval( Sensei()->settings->settings[ 'course_page' ] ); |
@@ -412,7 +415,7 @@ discard block |
||
| 412 | 415 | |
| 413 | 416 | return false; |
| 414 | 417 | |
| 415 | - }else{ |
|
| 418 | + } else{ |
|
| 416 | 419 | |
| 417 | 420 | return true; |
| 418 | 421 | |
@@ -446,7 +449,7 @@ discard block |
||
| 446 | 449 | |
| 447 | 450 | $wp_query = $modules_query; |
| 448 | 451 | |
| 449 | - }else{ |
|
| 452 | + } else{ |
|
| 450 | 453 | |
| 451 | 454 | wp_reset_query(); |
| 452 | 455 | |
@@ -478,7 +481,7 @@ discard block |
||
| 478 | 481 | |
| 479 | 482 | return have_posts(); |
| 480 | 483 | |
| 481 | - }else{ |
|
| 484 | + } else{ |
|
| 482 | 485 | |
| 483 | 486 | // if the loop has not been initiated check the first module has lessons |
| 484 | 487 | if( -1 == $sensei_modules_loop[ 'current' ] ){ |
@@ -622,7 +625,7 @@ discard block |
||
| 622 | 625 | |
| 623 | 626 | return true; |
| 624 | 627 | |
| 625 | - }else{ |
|
| 628 | + } else{ |
|
| 626 | 629 | |
| 627 | 630 | return false; |
| 628 | 631 | |
@@ -865,7 +868,9 @@ discard block |
||
| 865 | 868 | */ |
| 866 | 869 | function get_sensei_header(){ |
| 867 | 870 | |
| 868 | - if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 871 | + if ( ! defined( 'ABSPATH' ) ) { |
|
| 872 | + exit; |
|
| 873 | + } |
|
| 869 | 874 | |
| 870 | 875 | get_header(); |
| 871 | 876 | |
@@ -1,5 +1,8 @@ discard block |
||
| 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 Frontend Class |
@@ -668,7 +671,9 @@ discard block |
||
| 668 | 671 | public function sensei_breadcrumb( $id = 0 ) { |
| 669 | 672 | |
| 670 | 673 | // Only output on lesson, quiz and taxonomy (module) pages |
| 671 | - if( ! ( is_tax( 'module' ) || is_singular( 'lesson' ) || is_singular( 'quiz' ) ) ) return; |
|
| 674 | + if( ! ( is_tax( 'module' ) || is_singular( 'lesson' ) || is_singular( 'quiz' ) ) ) { |
|
| 675 | + return; |
|
| 676 | + } |
|
| 672 | 677 | |
| 673 | 678 | if( empty( $id ) ){ |
| 674 | 679 | |
@@ -1094,17 +1099,26 @@ discard block |
||
| 1094 | 1099 | |
| 1095 | 1100 | <p class="form-row form-row-wide"> |
| 1096 | 1101 | <label for="sensei_reg_username"><?php _e( 'Username', 'woothemes-sensei' ); ?> <span class="required">*</span></label> |
| 1097 | - <input type="text" class="input-text" name="sensei_reg_username" id="sensei_reg_username" value="<?php if ( ! empty( $_POST['sensei_reg_username'] ) ) esc_attr_e( $_POST['sensei_reg_username'] ); ?>" /> |
|
| 1102 | + <input type="text" class="input-text" name="sensei_reg_username" id="sensei_reg_username" value="<?php if ( ! empty( $_POST['sensei_reg_username'] ) ) { |
|
| 1103 | + esc_attr_e( $_POST['sensei_reg_username'] ); |
|
| 1104 | +} |
|
| 1105 | +?>" /> |
|
| 1098 | 1106 | </p> |
| 1099 | 1107 | |
| 1100 | 1108 | <p class="form-row form-row-wide"> |
| 1101 | 1109 | <label for="sensei_reg_email"><?php _e( 'Email address', 'woothemes-sensei' ); ?> <span class="required">*</span></label> |
| 1102 | - <input type="email" class="input-text" name="sensei_reg_email" id="sensei_reg_email" value="<?php if ( ! empty( $_POST['sensei_reg_email'] ) ) esc_attr_e( $_POST['sensei_reg_email'] ); ?>" /> |
|
| 1110 | + <input type="email" class="input-text" name="sensei_reg_email" id="sensei_reg_email" value="<?php if ( ! empty( $_POST['sensei_reg_email'] ) ) { |
|
| 1111 | + esc_attr_e( $_POST['sensei_reg_email'] ); |
|
| 1112 | +} |
|
| 1113 | +?>" /> |
|
| 1103 | 1114 | </p> |
| 1104 | 1115 | |
| 1105 | 1116 | <p class="form-row form-row-wide"> |
| 1106 | 1117 | <label for="sensei_reg_password"><?php _e( 'Password', 'woothemes-sensei' ); ?> <span class="required">*</span></label> |
| 1107 | - <input type="password" class="input-text" name="sensei_reg_password" id="sensei_reg_password" value="<?php if ( ! empty( $_POST['sensei_reg_password'] ) ) esc_attr_e( $_POST['sensei_reg_password'] ); ?>" /> |
|
| 1118 | + <input type="password" class="input-text" name="sensei_reg_password" id="sensei_reg_password" value="<?php if ( ! empty( $_POST['sensei_reg_password'] ) ) { |
|
| 1119 | + esc_attr_e( $_POST['sensei_reg_password'] ); |
|
| 1120 | +} |
|
| 1121 | +?>" /> |
|
| 1108 | 1122 | </p> |
| 1109 | 1123 | |
| 1110 | 1124 | <!-- Spam Trap --> |
@@ -1437,8 +1451,12 @@ discard block |
||
| 1437 | 1451 | |
| 1438 | 1452 | if( Sensei_WC::is_woocommerce_active() ) { |
| 1439 | 1453 | |
| 1440 | - if( ! is_user_logged_in() ) return; |
|
| 1441 | - if( ! isset( $post->ID ) ) return; |
|
| 1454 | + if( ! is_user_logged_in() ) { |
|
| 1455 | + return; |
|
| 1456 | + } |
|
| 1457 | + if( ! isset( $post->ID ) ) { |
|
| 1458 | + return; |
|
| 1459 | + } |
|
| 1442 | 1460 | |
| 1443 | 1461 | $user_id = $current_user->ID; |
| 1444 | 1462 | $course_id = $post->ID; |
@@ -1599,7 +1617,7 @@ discard block |
||
| 1599 | 1617 | //assigne the username to the creds array for further processing |
| 1600 | 1618 | $creds['user_login'] = $user->user_login ; |
| 1601 | 1619 | |
| 1602 | - }else{ |
|
| 1620 | + } else{ |
|
| 1603 | 1621 | |
| 1604 | 1622 | // process this as a default username login |
| 1605 | 1623 | $creds['user_login'] = sanitize_text_field( $_REQUEST['log'] ) ; |
@@ -1616,7 +1634,7 @@ discard block |
||
| 1616 | 1634 | if ( is_wp_error($user) ){ // on login failure |
| 1617 | 1635 | wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) ); |
| 1618 | 1636 | exit; |
| 1619 | - }else{ // on login success |
|
| 1637 | + } else{ // on login success |
|
| 1620 | 1638 | |
| 1621 | 1639 | /** |
| 1622 | 1640 | * change the redirect url programatically |
@@ -1633,14 +1651,14 @@ discard block |
||
| 1633 | 1651 | |
| 1634 | 1652 | } // end is_wp_error($user) |
| 1635 | 1653 | |
| 1636 | - }else{ // if username or password is empty |
|
| 1654 | + } else{ // if username or password is empty |
|
| 1637 | 1655 | |
| 1638 | 1656 | wp_redirect( esc_url_raw( add_query_arg('login', 'emptyfields', $referrer) ) ); |
| 1639 | 1657 | exit; |
| 1640 | 1658 | |
| 1641 | 1659 | } // end if username $_REQUEST['log'] and password $_REQUEST['pwd'] is empty |
| 1642 | 1660 | |
| 1643 | - }elseif( ( isset( $_GET['login'] ) ) ) { |
|
| 1661 | + } elseif( ( isset( $_GET['login'] ) ) ) { |
|
| 1644 | 1662 | // else if this request is a redircect from a previously faile login request |
| 1645 | 1663 | $this->login_message_process(); |
| 1646 | 1664 | |
@@ -1762,7 +1780,7 @@ discard block |
||
| 1762 | 1780 | |
| 1763 | 1781 | $message = __('Incorrect login details', 'woothemes-sensei' ); |
| 1764 | 1782 | |
| 1765 | - }elseif( $_GET['login'] == 'emptyfields' ){ |
|
| 1783 | + } elseif( $_GET['login'] == 'emptyfields' ){ |
|
| 1766 | 1784 | |
| 1767 | 1785 | $message= __('Please enter your username and password', 'woothemes-sensei' ); |
| 1768 | 1786 | } |
@@ -1,5 +1,8 @@ discard block |
||
| 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 Class |
@@ -342,7 +345,7 @@ discard block |
||
| 342 | 345 | |
| 343 | 346 | $name = $full_name; |
| 344 | 347 | |
| 345 | - }else{ |
|
| 348 | + } else{ |
|
| 346 | 349 | |
| 347 | 350 | $name = $full_name . ' ['. $user->display_name .']'; |
| 348 | 351 | |
@@ -359,11 +362,17 @@ discard block |
||
| 359 | 362 | |
| 360 | 363 | $result = false; |
| 361 | 364 | |
| 362 | - if( ! isset( $_POST['add_learner_submit'] ) ) return $result; |
|
| 365 | + if( ! isset( $_POST['add_learner_submit'] ) ) { |
|
| 366 | + return $result; |
|
| 367 | + } |
|
| 363 | 368 | |
| 364 | - if ( ! isset( $_POST['add_learner_nonce'] ) || ! wp_verify_nonce( $_POST['add_learner_nonce'], 'add_learner_to_sensei' ) ) return $result; |
|
| 369 | + if ( ! isset( $_POST['add_learner_nonce'] ) || ! wp_verify_nonce( $_POST['add_learner_nonce'], 'add_learner_to_sensei' ) ) { |
|
| 370 | + return $result; |
|
| 371 | + } |
|
| 365 | 372 | |
| 366 | - if( ( ! isset( $_POST['add_user_id'] ) || '' == $_POST['add_user_id'] ) || ! isset( $_POST['add_post_type'] ) || ! isset( $_POST['add_course_id'] ) || ! isset( $_POST['add_lesson_id'] ) ) return $result; |
|
| 373 | + if( ( ! isset( $_POST['add_user_id'] ) || '' == $_POST['add_user_id'] ) || ! isset( $_POST['add_post_type'] ) || ! isset( $_POST['add_course_id'] ) || ! isset( $_POST['add_lesson_id'] ) ) { |
|
| 374 | + return $result; |
|
| 375 | + } |
|
| 367 | 376 | |
| 368 | 377 | $post_type = $_POST['add_post_type']; |
| 369 | 378 | $user_id = absint( $_POST['add_user_id'] ); |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | |
| 167 | 167 | Sensei_Templates::get_template( 'user/my-courses.php' ); |
| 168 | 168 | |
| 169 | - }else{ |
|
| 169 | + } else{ |
|
| 170 | 170 | |
| 171 | 171 | Sensei()->frontend->sensei_login_form(); |
| 172 | 172 | |
@@ -1,5 +1,8 @@ |
||
| 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 User Profile List Table Class |
@@ -1,5 +1,8 @@ discard block |
||
| 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 |
@@ -616,7 +619,7 @@ discard block |
||
| 616 | 619 | |
| 617 | 620 | return $results_array; |
| 618 | 621 | |
| 619 | - }else{ |
|
| 622 | + } else{ |
|
| 620 | 623 | |
| 621 | 624 | //reset the pagination as this widgets do not need it |
| 622 | 625 | $post_args['paged'] = 1; |
@@ -837,7 +840,7 @@ discard block |
||
| 837 | 840 | |
| 838 | 841 | return $html; |
| 839 | 842 | |
| 840 | - }else{ |
|
| 843 | + } else{ |
|
| 841 | 844 | |
| 842 | 845 | echo $html; |
| 843 | 846 | |
@@ -984,8 +987,7 @@ discard block |
||
| 984 | 987 | $has_questions = get_post_meta( $lesson_id, '_quiz_has_questions', true ); |
| 985 | 988 | if ( $has_questions && $boolean_check ) { |
| 986 | 989 | return true; |
| 987 | - } |
|
| 988 | - elseif ( $has_questions ) { |
|
| 990 | + } elseif ( $has_questions ) { |
|
| 989 | 991 | $quiz_id = Sensei()->lesson->lesson_quizzes( $lesson_id ); |
| 990 | 992 | // $questions = Sensei()->lesson->lesson_quiz_questions( $quiz_id ); |
| 991 | 993 | // if( count( $questions ) > 0 ) { |
@@ -1798,11 +1800,11 @@ discard block |
||
| 1798 | 1800 | |
| 1799 | 1801 | $course_id = $email['course_id']; |
| 1800 | 1802 | |
| 1801 | - }elseif( isset( $email['lesson_id'] ) ){ |
|
| 1803 | + } elseif( isset( $email['lesson_id'] ) ){ |
|
| 1802 | 1804 | |
| 1803 | 1805 | $course_id = Sensei()->lesson->get_course_id( $email['lesson_id'] ); |
| 1804 | 1806 | |
| 1805 | - }elseif( isset( $email['quiz_id'] ) ){ |
|
| 1807 | + } elseif( isset( $email['quiz_id'] ) ){ |
|
| 1806 | 1808 | |
| 1807 | 1809 | $lesson_id = Sensei()->quiz->get_lesson_id( $email['quiz_id'] ); |
| 1808 | 1810 | $course_id = Sensei()->lesson->get_course_id( $lesson_id ); |
@@ -1863,7 +1865,7 @@ discard block |
||
| 1863 | 1865 | |
| 1864 | 1866 | if( isset( $_POST['disable_sensei_course_notification'] ) && 'on'== $_POST['disable_sensei_course_notification'] ) { |
| 1865 | 1867 | $new_val = true; |
| 1866 | - }else{ |
|
| 1868 | + } else{ |
|
| 1867 | 1869 | $new_val = false; |
| 1868 | 1870 | } |
| 1869 | 1871 | |
@@ -1996,7 +1998,7 @@ discard block |
||
| 1996 | 1998 | |
| 1997 | 1999 | $classes[] = 'user-status-completed'; |
| 1998 | 2000 | |
| 1999 | - }else{ |
|
| 2001 | + } else{ |
|
| 2000 | 2002 | |
| 2001 | 2003 | $classes[] = 'user-status-active'; |
| 2002 | 2004 | |
@@ -2516,7 +2518,7 @@ discard block |
||
| 2516 | 2518 | |
| 2517 | 2519 | $title = __('Lessons', 'woothemes-sensei'); |
| 2518 | 2520 | |
| 2519 | - }elseif( empty( $none_module_lessons ) ){ // if the none module lessons are simply empty the title should not be shown |
|
| 2521 | + } elseif( empty( $none_module_lessons ) ){ // if the none module lessons are simply empty the title should not be shown |
|
| 2520 | 2522 | |
| 2521 | 2523 | $title = ''; |
| 2522 | 2524 | } |
@@ -2844,7 +2846,7 @@ discard block |
||
| 2844 | 2846 | |
| 2845 | 2847 | $title = $term->name; |
| 2846 | 2848 | |
| 2847 | - }else{ |
|
| 2849 | + } else{ |
|
| 2848 | 2850 | |
| 2849 | 2851 | $title = 'Course Category'; |
| 2850 | 2852 | |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 3 | 5 | /** |
| 4 | 6 | * The Template for displaying the my course page data. |
| 5 | 7 | * |
@@ -1,5 +1,8 @@ discard block |
||
| 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 | * A settings API (wrapping the WordPress Settings API). |
@@ -315,8 +318,9 @@ discard block |
||
| 315 | 318 | |
| 316 | 319 | echo '<section id="' . $section_id . '">'; |
| 317 | 320 | |
| 318 | - if ($section['name']) |
|
| 319 | - echo "<h2>{$section['name']}</h2>\n"; |
|
| 321 | + if ($section['name']) { |
|
| 322 | + echo "<h2>{$section['name']}</h2>\n"; |
|
| 323 | + } |
|
| 320 | 324 | |
| 321 | 325 | echo '<table class="form-table">'; |
| 322 | 326 | do_settings_fields($page, $section_id ); |