@@ -31,9 +31,12 @@ |
||
| 31 | 31 | |
| 32 | 32 | <?php sensei_load_template('loop-message.php'); ?> |
| 33 | 33 | |
| 34 | - <?php else: ?> |
|
| 34 | + <?php else { |
|
| 35 | + : ?> |
|
| 35 | 36 | |
| 36 | - <p> <?php _e('You do not have any messages.','woothemes-sensei'); ?> </p> |
|
| 37 | + <p> <?php _e('You do not have any messages.','woothemes-sensei'); |
|
| 38 | +} |
|
| 39 | +?> </p> |
|
| 37 | 40 | |
| 38 | 41 | <?php endif; // End If Statement ?> |
| 39 | 42 | |
@@ -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 | * |
@@ -28,7 +28,10 @@ |
||
| 28 | 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | - if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 31 | + if ( ! defined( 'ABSPATH' ) ) { |
|
| 32 | + exit; |
|
| 33 | + } |
|
| 34 | + // Exit if accessed directly |
|
| 32 | 35 | |
| 33 | 36 | require_once( 'includes/class-sensei-autoloader.php' ); |
| 34 | 37 | require_once( 'includes/lib/woo-functions.php' ); |
@@ -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 | * Renders the [sensei_courses] shortcode |
@@ -77,7 +80,7 @@ discard block |
||
| 77 | 80 | |
| 78 | 81 | $this->order = 'ASC'; |
| 79 | 82 | |
| 80 | - }else{ |
|
| 83 | + } else{ |
|
| 81 | 84 | |
| 82 | 85 | // for everything else use the value passed or the default DESC |
| 83 | 86 | $this->order = isset( $attributes['order'] ) ? $attributes['order'] : 'DESC'; |
@@ -139,7 +142,7 @@ discard block |
||
| 139 | 142 | $teacher_query_by = 'author__in'; |
| 140 | 143 | $this->teacher = $teachers; |
| 141 | 144 | |
| 142 | - }else{ |
|
| 145 | + } else{ |
|
| 143 | 146 | // when users passed in a single teacher value |
| 144 | 147 | $teacher_query_by = is_numeric( $this->teacher )? 'author':'author_name'; |
| 145 | 148 | |
@@ -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 | * This class is loaded int WP by the shortcode loader class. |
| 5 | 8 | * |
@@ -75,7 +78,7 @@ discard block |
||
| 75 | 78 | |
| 76 | 79 | $this->order = 'ASC'; |
| 77 | 80 | |
| 78 | - }else{ |
|
| 81 | + } else{ |
|
| 79 | 82 | |
| 80 | 83 | // for everything else use the value passed or the default DESC |
| 81 | 84 | $this->order = isset( $attributes['order'] ) ? $attributes['order'] : 'ASC'; |
@@ -121,11 +124,11 @@ discard block |
||
| 121 | 124 | $included_courses = $completed_ids; |
| 122 | 125 | |
| 123 | 126 | |
| 124 | - }elseif( 'active'==$this->status ){ |
|
| 127 | + } elseif( 'active'==$this->status ){ |
|
| 125 | 128 | |
| 126 | 129 | $included_courses = $active_ids; |
| 127 | 130 | |
| 128 | - }else{ // all courses |
|
| 131 | + } else{ // all courses |
|
| 129 | 132 | |
| 130 | 133 | if( empty( $completed_ids ) ){ |
| 131 | 134 | |
@@ -142,7 +145,7 @@ discard block |
||
| 142 | 145 | |
| 143 | 146 | $included_courses = array('-1000'); // don't show any courses |
| 144 | 147 | |
| 145 | - }else{ |
|
| 148 | + } else{ |
|
| 146 | 149 | $included_courses = Sensei_Utils::array_zip_merge( $active_ids, $completed_ids ); |
| 147 | 150 | } |
| 148 | 151 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // security check |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// security check |
|
| 3 | 6 | /** |
| 4 | 7 | * Sensei Shortcode Loader Class |
| 5 | 8 | * |
@@ -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 | * Renders the [sensei_teachers] shortcode. Will show a list of teachers |
@@ -149,7 +152,7 @@ discard block |
||
| 149 | 152 | // exclude this user as it is already in the list |
| 150 | 153 | unset( $users[ $index ] ); |
| 151 | 154 | |
| 152 | - }else{ |
|
| 155 | + } else{ |
|
| 153 | 156 | |
| 154 | 157 | // add teh user to the list of users |
| 155 | 158 | $array_unique_users_ids[] = $user->ID; |
@@ -239,9 +242,7 @@ discard block |
||
| 239 | 242 | |
| 240 | 243 | $user_public_name = $user->first_name . ' ' . $user->last_name; |
| 241 | 244 | |
| 242 | - } |
|
| 243 | - |
|
| 244 | - else { |
|
| 245 | + } else { |
|
| 245 | 246 | |
| 246 | 247 | $user_public_name = $user->display_name; |
| 247 | 248 | |
@@ -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 @@ 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_Main |
@@ -156,7 +159,9 @@ discard block |
||
| 156 | 159 | $this->init(); |
| 157 | 160 | |
| 158 | 161 | // Installation |
| 159 | - if ( is_admin() && ! defined( 'DOING_AJAX' ) ) $this->install(); |
|
| 162 | + if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { |
|
| 163 | + $this->install(); |
|
| 164 | + } |
|
| 160 | 165 | |
| 161 | 166 | // Run this on activation. |
| 162 | 167 | register_activation_hook( $this->file, array( $this, 'activation' ) ); |
@@ -442,7 +447,9 @@ discard block |
||
| 442 | 447 | **/ |
| 443 | 448 | public function virtual_order_payment_complete( $order_status, $order_id ) { |
| 444 | 449 | $order = new WC_Order( $order_id ); |
| 445 | - if ( ! isset ( $order ) ) return; |
|
| 450 | + if ( ! isset ( $order ) ) { |
|
| 451 | + return; |
|
| 452 | + } |
|
| 446 | 453 | if ( $order_status == 'wc-processing' && ( $order->post_status == 'wc-on-hold' || $order->post_status == 'wc-pending' || $order->post_status == 'wc-failed' ) ) { |
| 447 | 454 | $virtual_order = true; |
| 448 | 455 | |
@@ -606,7 +613,7 @@ discard block |
||
| 606 | 613 | |
| 607 | 614 | $sensei_plugin_path = $this->plugin_path; |
| 608 | 615 | |
| 609 | - }else{ |
|
| 616 | + } else{ |
|
| 610 | 617 | |
| 611 | 618 | $sensei_plugin_path = plugin_dir_path( __FILE__ ); |
| 612 | 619 | |
@@ -641,7 +648,9 @@ discard block |
||
| 641 | 648 | public function woocommerce_course_update ( $course_id = 0, $order_user = array() ) { |
| 642 | 649 | global $current_user; |
| 643 | 650 | |
| 644 | - if ( ! isset( $current_user ) || !$current_user->ID > 0 ) return; |
|
| 651 | + if ( ! isset( $current_user ) || !$current_user->ID > 0 ) { |
|
| 652 | + return; |
|
| 653 | + } |
|
| 645 | 654 | |
| 646 | 655 | $data_update = false; |
| 647 | 656 | |
@@ -725,8 +734,7 @@ discard block |
||
| 725 | 734 | |
| 726 | 735 | $prerequisite_complete = WooThemes_Sensei_Utils::user_completed_course( $course_prerequisite_id, $current_user->ID ); |
| 727 | 736 | |
| 728 | - } |
|
| 729 | - else { |
|
| 737 | + } else { |
|
| 730 | 738 | $prerequisite_complete = true; |
| 731 | 739 | } // End If Statement |
| 732 | 740 | // Handles restrictions |
@@ -853,7 +861,9 @@ discard block |
||
| 853 | 861 | */ |
| 854 | 862 | public function access_settings () { |
| 855 | 863 | |
| 856 | - if( sensei_all_access() ) return true; |
|
| 864 | + if( sensei_all_access() ) { |
|
| 865 | + return true; |
|
| 866 | + } |
|
| 857 | 867 | |
| 858 | 868 | if ( isset( $this->settings->settings['access_permission'] ) && ( true == $this->settings->settings['access_permission'] ) ) { |
| 859 | 869 | if ( is_user_logged_in() ) { |
@@ -1182,8 +1192,9 @@ discard block |
||
| 1182 | 1192 | } |
| 1183 | 1193 | $where = "WHERE comment_type IN ('" . join("', '", array_unique( $statuses ) ) . "')"; |
| 1184 | 1194 | |
| 1185 | - if ( $post_id > 0 ) |
|
| 1186 | - $where .= $wpdb->prepare( " AND comment_post_ID = %d", $post_id ); |
|
| 1195 | + if ( $post_id > 0 ) { |
|
| 1196 | + $where .= $wpdb->prepare( " AND comment_post_ID = %d", $post_id ); |
|
| 1197 | + } |
|
| 1187 | 1198 | |
| 1188 | 1199 | $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A ); |
| 1189 | 1200 | |
@@ -1191,16 +1202,19 @@ discard block |
||
| 1191 | 1202 | $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed'); |
| 1192 | 1203 | foreach ( (array) $count as $row ) { |
| 1193 | 1204 | // Don't count post-trashed toward totals |
| 1194 | - if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] ) |
|
| 1195 | - $total += $row['num_comments']; |
|
| 1196 | - if ( isset( $approved[$row['comment_approved']] ) ) |
|
| 1197 | - $stats[$approved[$row['comment_approved']]] = $row['num_comments']; |
|
| 1205 | + if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] ) { |
|
| 1206 | + $total += $row['num_comments']; |
|
| 1207 | + } |
|
| 1208 | + if ( isset( $approved[$row['comment_approved']] ) ) { |
|
| 1209 | + $stats[$approved[$row['comment_approved']]] = $row['num_comments']; |
|
| 1210 | + } |
|
| 1198 | 1211 | } |
| 1199 | 1212 | |
| 1200 | 1213 | $stats['total_comments'] = $total; |
| 1201 | 1214 | foreach ( $approved as $key ) { |
| 1202 | - if ( empty($stats[$key]) ) |
|
| 1203 | - $stats[$key] = 0; |
|
| 1215 | + if ( empty($stats[$key]) ) { |
|
| 1216 | + $stats[$key] = 0; |
|
| 1217 | + } |
|
| 1204 | 1218 | } |
| 1205 | 1219 | |
| 1206 | 1220 | $stats = (object) $stats; |
@@ -1241,8 +1255,9 @@ discard block |
||
| 1241 | 1255 | public function get_image_size( $image_size ) { |
| 1242 | 1256 | |
| 1243 | 1257 | // Only return sizes we define in settings |
| 1244 | - if ( ! in_array( $image_size, array( 'course_archive_image', 'course_single_image', 'lesson_archive_image', 'lesson_single_image' ) ) ) |
|
| 1245 | - return apply_filters( 'sensei_get_image_size_' . $image_size, '' ); |
|
| 1258 | + if ( ! in_array( $image_size, array( 'course_archive_image', 'course_single_image', 'lesson_archive_image', 'lesson_single_image' ) ) ) { |
|
| 1259 | + return apply_filters( 'sensei_get_image_size_' . $image_size, '' ); |
|
| 1260 | + } |
|
| 1246 | 1261 | |
| 1247 | 1262 | if( ! isset( $this->settings->settings[ $image_size . '_width' ] ) ) { |
| 1248 | 1263 | $this->settings->settings[ $image_size . '_width' ] = false; |
@@ -1305,7 +1320,7 @@ discard block |
||
| 1305 | 1320 | require_once( 'class-sensei-modules.php'); |
| 1306 | 1321 | Sensei()->modules = new Sensei_Core_Modules( $this->file ); |
| 1307 | 1322 | |
| 1308 | - }else{ |
|
| 1323 | + } else{ |
|
| 1309 | 1324 | // fallback for people still using the modules extension. |
| 1310 | 1325 | global $sensei_modules; |
| 1311 | 1326 | Sensei()->modules = $sensei_modules; |
@@ -1352,7 +1367,7 @@ discard block |
||
| 1352 | 1367 | |
| 1353 | 1368 | update_option('sensei_flush_rewrite_rules', '2'); |
| 1354 | 1369 | |
| 1355 | - }elseif( '2' == $option ) { |
|
| 1370 | + } elseif( '2' == $option ) { |
|
| 1356 | 1371 | |
| 1357 | 1372 | flush_rewrite_rules(); |
| 1358 | 1373 | update_option('sensei_flush_rewrite_rules', '0'); |