Completed
Push — master ( 201c1b...d51ce1 )
by Dwain
04:57
created
templates/archive-message.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The Template for displaying message archives.
4
- *
5
- * Override this template by copying it to yourtheme/sensei/archive-message.php
6
- *
7
- * @author 		Automattic
8
- * @package 	Sensei
9
- * @category    Templates
10
- * @version     1.9.0
11
- */
3
+	 * The Template for displaying message archives.
4
+	 *
5
+	 * Override this template by copying it to yourtheme/sensei/archive-message.php
6
+	 *
7
+	 * @author 		Automattic
8
+	 * @package 	Sensei
9
+	 * @category    Templates
10
+	 * @version     1.9.0
11
+	 */
12 12
 ?>
13 13
 
14 14
 <?php  get_sensei_header();  ?>
15 15
 
16 16
 <?php
17 17
 /**
18
- * This action before course messages archive loop. This hook fires within the archive-message.php file.
19
- * It fires even if the current archive has no no messages.
20
- *
21
- * @since 1.9.0
22
- *
23
- * @hooked Sensei_Messages::the_archive_header -20
24
- */
18
+	 * This action before course messages archive loop. This hook fires within the archive-message.php file.
19
+	 * It fires even if the current archive has no no messages.
20
+	 *
21
+	 * @since 1.9.0
22
+	 *
23
+	 * @hooked Sensei_Messages::the_archive_header -20
24
+	 */
25 25
 do_action( 'sensei_archive_before_message_loop' );
26 26
 ?>
27 27
 
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 
42 42
 <?php
43 43
 /**
44
- * This action before course messages archive loop. This hook fires within the archive-message.php file.
45
- * It fires even if the current archive has no no messages.
46
- *
47
- * @since 1.9.0
48
- */
44
+	 * This action before course messages archive loop. This hook fires within the archive-message.php file.
45
+	 * It fires even if the current archive has no no messages.
46
+	 *
47
+	 * @since 1.9.0
48
+	 */
49 49
 do_action( 'sensei_archive_after_message_loop' );
50 50
 ?>
51 51
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 ?>
13 13
 
14
-<?php  get_sensei_header();  ?>
14
+<?php  get_sensei_header(); ?>
15 15
 
16 16
 <?php
17 17
 /**
@@ -22,18 +22,18 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @hooked Sensei_Messages::the_archive_header -20
24 24
  */
25
-do_action( 'sensei_archive_before_message_loop' );
25
+do_action('sensei_archive_before_message_loop');
26 26
 ?>
27 27
 
28 28
 <section id="main-sensei_message" class="sensei_message-container">
29 29
 
30
-    <?php if ( have_posts() ): ?>
30
+    <?php if (have_posts()): ?>
31 31
 
32 32
         <?php sensei_load_template('loop-message.php'); ?>
33 33
 
34 34
     <?php else: ?>
35 35
 
36
-        <p> <?php _e('You do not have any messages.','woothemes-sensei'); ?> </p>
36
+        <p> <?php _e('You do not have any messages.', 'woothemes-sensei'); ?> </p>
37 37
 
38 38
     <?php  endif; // End If Statement ?>
39 39
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @since 1.9.0
48 48
  */
49
-do_action( 'sensei_archive_after_message_loop' );
49
+do_action('sensei_archive_after_message_loop');
50 50
 ?>
51 51
 
52 52
 <?php get_sensei_footer(); ?>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,12 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
templates/loop-course.php 3 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,69 +1,69 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) exit;
3 3
 /**
4
- * The Template for outputting Lists of any Sensei content type.
5
- *
6
- * This template expects the global wp_query to setup and ready for the loop
7
- *
8
- * @author 		Automattic
9
- * @package 	Sensei
10
- * @category    Templates
11
- * @version     1.9.0
12
- */
4
+	 * The Template for outputting Lists of any Sensei content type.
5
+	 *
6
+	 * This template expects the global wp_query to setup and ready for the loop
7
+	 *
8
+	 * @author 		Automattic
9
+	 * @package 	Sensei
10
+	 * @category    Templates
11
+	 * @version     1.9.0
12
+	 */
13 13
 ?>
14 14
 
15 15
 <?php
16 16
 /**
17
- * This runs before the the course loop items in the loop.php template. It runs
18
- * only only for the course post type. This loop will not run if the current wp_query
19
- * has no posts.
20
- *
21
- * @since 1.9.0
22
- */
17
+	 * This runs before the the course loop items in the loop.php template. It runs
18
+	 * only only for the course post type. This loop will not run if the current wp_query
19
+	 * has no posts.
20
+	 *
21
+	 * @since 1.9.0
22
+	 */
23 23
 do_action( 'sensei_loop_course_before' );
24 24
 ?>
25 25
 
26 26
 <ul class="course-container columns-<?php sensei_courses_per_row(); ?>" >
27 27
 
28 28
     <?php
29
-    /**
30
-     * This runs before the post type items in the loop.php template. It
31
-     * runs within the courses loop <ul> tag.
32
-     *
33
-     * @since 1.9.0
34
-     */
35
-    do_action( 'sensei_loop_course_inside_before' );
36
-    ?>
29
+	/**
30
+	 * This runs before the post type items in the loop.php template. It
31
+	 * runs within the courses loop <ul> tag.
32
+	 *
33
+	 * @since 1.9.0
34
+	 */
35
+	do_action( 'sensei_loop_course_inside_before' );
36
+	?>
37 37
 
38 38
     <?php
39
-    /*
39
+	/*
40 40
      * Loop through all courses
41 41
      */
42
-    while ( have_posts() ) { the_post();
42
+	while ( have_posts() ) { the_post();
43 43
 
44
-        sensei_load_template_part('content','course');
44
+		sensei_load_template_part('content','course');
45 45
 
46
-    }
47
-    ?>
46
+	}
47
+	?>
48 48
 
49 49
     <?php
50
-    /**
51
-     * This runs after the post type items in the loop.php template. It runs
52
-     * only for the specified post type
53
-     *
54
-     * @since 1.9.0
55
-     */
56
-    do_action( 'sensei_loop_course_inside_after' );
57
-    ?>
50
+	/**
51
+	 * This runs after the post type items in the loop.php template. It runs
52
+	 * only for the specified post type
53
+	 *
54
+	 * @since 1.9.0
55
+	 */
56
+	do_action( 'sensei_loop_course_inside_after' );
57
+	?>
58 58
 
59 59
 </ul>
60 60
 
61 61
 <?php
62 62
 /**
63
- * This runs after the post type items in the loop.php template. It runs
64
- * only for the specified post type
65
- *
66
- * @since 1.9.0
67
- */
63
+	 * This runs after the post type items in the loop.php template. It runs
64
+	 * only for the specified post type
65
+	 *
66
+	 * @since 1.9.0
67
+	 */
68 68
 do_action( 'sensei_loop_course_after' );
69 69
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 /**
4 4
  * The Template for outputting Lists of any Sensei content type.
5 5
  *
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * @since 1.9.0
22 22
  */
23
-do_action( 'sensei_loop_course_before' );
23
+do_action('sensei_loop_course_before');
24 24
 ?>
25 25
 
26 26
 <ul class="course-container columns-<?php sensei_courses_per_row(); ?>" >
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @since 1.9.0
34 34
      */
35
-    do_action( 'sensei_loop_course_inside_before' );
35
+    do_action('sensei_loop_course_inside_before');
36 36
     ?>
37 37
 
38 38
     <?php
39 39
     /*
40 40
      * Loop through all courses
41 41
      */
42
-    while ( have_posts() ) { the_post();
42
+    while (have_posts()) { the_post();
43 43
 
44
-        sensei_load_template_part('content','course');
44
+        sensei_load_template_part('content', 'course');
45 45
 
46 46
     }
47 47
     ?>
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @since 1.9.0
55 55
      */
56
-    do_action( 'sensei_loop_course_inside_after' );
56
+    do_action('sensei_loop_course_inside_after');
57 57
     ?>
58 58
 
59 59
 </ul>
@@ -65,5 +65,5 @@  discard block
 block discarded – undo
65 65
  *
66 66
  * @since 1.9.0
67 67
  */
68
-do_action( 'sensei_loop_course_after' );
68
+do_action('sensei_loop_course_after');
69 69
 ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
templates/content-course.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 /**
4 4
  * Content-course.php template file
5 5
  *
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  */
15 15
 ?>
16 16
 
17
-<li <?php post_class(  WooThemes_Sensei_Course::get_course_loop_content_class() ); ?> >
17
+<li <?php post_class(WooThemes_Sensei_Course::get_course_loop_content_class()); ?> >
18 18
 
19 19
     <?php
20 20
     /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @param $post
27 27
      */
28
-    do_action( 'sensei_course_content_before', get_post() );
28
+    do_action('sensei_course_content_before', get_post());
29 29
     ?>
30 30
 
31 31
     <section class="course-content">
@@ -84,4 +84,4 @@  discard block
 block discarded – undo
84 84
     ?>
85 85
 
86 86
 
87
-</li> <!-- article .(<?php esc_attr_e( join( ' ', get_post_class( array( 'course', 'post' ) ) ) ); ?>  -->
88 87
\ No newline at end of file
88
+</li> <!-- article .(<?php esc_attr_e(join(' ', get_post_class(array('course', 'post')))); ?>  -->
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) exit;
3 3
 /**
4
- * Content-course.php template file
5
- *
6
- * responsible for content on archive like pages. Only shows the course excerpt.
7
- *
8
- * For single course content please see single-course.php
9
- *
10
- * @author 		Automattic
11
- * @package 	Sensei
12
- * @category    Templates
13
- * @version     1.9.0
14
- */
4
+		 * Content-course.php template file
5
+		 *
6
+		 * responsible for content on archive like pages. Only shows the course excerpt.
7
+		 *
8
+		 * For single course content please see single-course.php
9
+		 *
10
+		 * @author 		Automattic
11
+		 * @package 	Sensei
12
+		 * @category    Templates
13
+		 * @version     1.9.0
14
+		 */
15 15
 ?>
16 16
 
17 17
 <li <?php post_class(  WooThemes_Sensei_Course::get_course_loop_content_class() ); ?> >
18 18
 
19 19
     <?php
20
-    /**
21
-     * This action runs before the sensei course content. It runs inside the sensei
22
-     * content-course.php template.
23
-     *
24
-     * @since 1.9
25
-     *
26
-     * @param $post
27
-     */
28
-    do_action( 'sensei_course_content_before', get_post() );
29
-    ?>
20
+	/**
21
+	 * This action runs before the sensei course content. It runs inside the sensei
22
+	 * content-course.php template.
23
+	 *
24
+	 * @since 1.9
25
+	 *
26
+	 * @param $post
27
+	 */
28
+	do_action( 'sensei_course_content_before', get_post() );
29
+	?>
30 30
 
31 31
     <section class="course-content">
32 32
 
33 33
         <section class="entry">
34 34
 
35 35
             <?php
36
-            /**
37
-             * Fires just before the course content in the content-course.php file.
38
-             *
39
-             * @since 1.9
40
-             *
41
-             * @param WP_Post $post
42
-             *
43
-             * @hooked Sensei_Templates::the_title          - 5
44
-             * @hooked Sensei()->course->course_image       - 10
45
-             * @hooked  Sensei()->course->the_course_meta   - 20
46
-             */
47
-            do_action('sensei_course_content_inside_before', get_post());
48
-            ?>
36
+			/**
37
+			 * Fires just before the course content in the content-course.php file.
38
+			 *
39
+			 * @since 1.9
40
+			 *
41
+			 * @param WP_Post $post
42
+			 *
43
+			 * @hooked Sensei_Templates::the_title          - 5
44
+			 * @hooked Sensei()->course->course_image       - 10
45
+			 * @hooked  Sensei()->course->the_course_meta   - 20
46
+			 */
47
+			do_action('sensei_course_content_inside_before', get_post());
48
+			?>
49 49
 
50 50
             <p class="course-excerpt">
51 51
 
@@ -54,34 +54,34 @@  discard block
 block discarded – undo
54 54
             </p>
55 55
 
56 56
             <?php
57
-            /**
58
-             * Fires just after the course content in the content-course.php file.
59
-             *
60
-             * @since 1.9
61
-             *
62
-             * @param WP_Post $post
63
-             *
64
-             * @hooked  Sensei()->course->the_course_free_lesson_preview - 20
65
-             */
66
-            do_action('sensei_course_content_inside_after', get_post());
67
-            ?>
57
+			/**
58
+			 * Fires just after the course content in the content-course.php file.
59
+			 *
60
+			 * @since 1.9
61
+			 *
62
+			 * @param WP_Post $post
63
+			 *
64
+			 * @hooked  Sensei()->course->the_course_free_lesson_preview - 20
65
+			 */
66
+			do_action('sensei_course_content_inside_after', get_post());
67
+			?>
68 68
 
69 69
         </section> <!-- section .entry -->
70 70
 
71 71
     </section> <!-- section .course-content -->
72 72
 
73 73
     <?php
74
-    /**
75
-     * Fires after the course block in the content-course.php file.
76
-     *
77
-     * @since 1.9
78
-     *
79
-     * @param WP_Post $post
80
-     *
81
-     * @hooked  Sensei()->course->the_course_free_lesson_preview - 20
82
-     */
83
-    do_action('sensei_course_content_after', get_post());
84
-    ?>
74
+	/**
75
+	 * Fires after the course block in the content-course.php file.
76
+	 *
77
+	 * @since 1.9
78
+	 *
79
+	 * @param WP_Post $post
80
+	 *
81
+	 * @hooked  Sensei()->course->the_course_free_lesson_preview - 20
82
+	 */
83
+	do_action('sensei_course_content_after', get_post());
84
+	?>
85 85
 
86 86
 
87 87
 </li> <!-- article .(<?php esc_attr_e( join( ' ', get_post_class( array( 'course', 'post' ) ) ) ); ?>  -->
88 88
\ No newline at end of file
Please login to merge, or discard this patch.
templates/user/login-form.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 <form method="post" name="sensi-login-form" id="loginform" class="login sensei">
28 28
 
29 29
     <?php
30
-    /**
31
-     *  Executes inside the sensei login form before all the default fields.
32
-     *
33
-     * @since 1.6.2
34
-     */
35
-        do_action( 'sensei_login_form_inside_before' );
36
-    ?>
30
+	/**
31
+	 *  Executes inside the sensei login form before all the default fields.
32
+	 *
33
+	 * @since 1.6.2
34
+	 */
35
+		do_action( 'sensei_login_form_inside_before' );
36
+	?>
37 37
 
38 38
 	<p class="sensei-login-username form-row form-row-wide">
39 39
 
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 	</p>
53 53
 
54 54
     <?php
55
-    /**
56
-     *  Executes inside the sensei login form after the password field.
57
-     *
58
-     *  You can use the action to add extra form login fields.
59
-     *
60
-     * @since 1.6.2
61
-     */
62
-        do_action( 'sensei_login_form_inside_after_password_field' );
63
-    ?>
55
+	/**
56
+	 *  Executes inside the sensei login form after the password field.
57
+	 *
58
+	 *  You can use the action to add extra form login fields.
59
+	 *
60
+	 * @since 1.6.2
61
+	 */
62
+		do_action( 'sensei_login_form_inside_after_password_field' );
63
+	?>
64 64
 
65 65
 	<p class='sensei-login-submit'>
66 66
 
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 	</p>
82 82
 
83 83
     <?php
84
-    /**
85
-     *  Executes inside the sensei login form after all the default fields.
86
-     *
87
-     * @since 1.6.2
88
-     */
89
-        do_action( 'sensei_login_form_inside_after' );
90
-    ?>
84
+	/**
85
+	 *  Executes inside the sensei login form after all the default fields.
86
+	 *
87
+	 * @since 1.6.2
88
+	 */
89
+		do_action( 'sensei_login_form_inside_after' );
90
+	?>
91 91
 
92 92
 	<?php wp_nonce_field( 'sensei-login' ); ?>
93 93
 
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
 
102 102
 <?php
103 103
 /**
104
- *  Executes after the Login form markup closes.
105
- *
106
- *  @since 1.9.0
107
- */
104
+	 *  Executes after the Login form markup closes.
105
+	 *
106
+	 *  @since 1.9.0
107
+	 */
108 108
 do_action( 'sensei_login_form_after' );
109 109
 ?>
110 110
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * The Template for displaying the sensei login form
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @since 1.9.0
21 21
  */
22
-do_action( 'sensei_login_form_before' );
22
+do_action('sensei_login_form_before');
23 23
 ?>
24 24
 
25
-<h2><?php _e( 'Login', 'woothemes-sensei' ); ?></h2>
25
+<h2><?php _e('Login', 'woothemes-sensei'); ?></h2>
26 26
 
27 27
 <form method="post" name="sensi-login-form" id="loginform" class="login sensei">
28 28
 
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @since 1.6.2
34 34
      */
35
-        do_action( 'sensei_login_form_inside_before' );
35
+        do_action('sensei_login_form_inside_before');
36 36
     ?>
37 37
 
38 38
 	<p class="sensei-login-username form-row form-row-wide">
39 39
 
40
-				<label for="sensei_user_login"><?php _e('Username or Email','woothemes-sensei')?> </label>
40
+				<label for="sensei_user_login"><?php _e('Username or Email', 'woothemes-sensei')?> </label>
41 41
 
42 42
 				<input type="text" name="log" id="sensei_user_login" class="input" value="" size="20">
43 43
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 	<p class="sensei-login-password form-row form-row-wide">
47 47
 
48
-				<label for="sensei_user_pass"> <?php _e('Password','woothemes-sensei')?>  </label>
48
+				<label for="sensei_user_pass"> <?php _e('Password', 'woothemes-sensei')?>  </label>
49 49
 
50 50
 				<input type="password" name="pwd" id="sensei_user_pass" class="input txt text" value="" size="20">
51 51
 
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
      *
60 60
      * @since 1.6.2
61 61
      */
62
-        do_action( 'sensei_login_form_inside_after_password_field' );
62
+        do_action('sensei_login_form_inside_after_password_field');
63 63
     ?>
64 64
 
65 65
 	<p class='sensei-login-submit'>
66 66
 
67
-		<input type="submit" class="button" name="login" value="<?php _e( 'Login', 'woothemes-sensei' ); ?>" />
67
+		<input type="submit" class="button" name="login" value="<?php _e('Login', 'woothemes-sensei'); ?>" />
68 68
 
69
-		<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'woothemes-sensei' ); ?></a>
69
+		<a href="<?php echo esc_url(wp_lostpassword_url()); ?>"><?php _e('Lost your password?', 'woothemes-sensei'); ?></a>
70 70
 
71 71
 	</p>
72 72
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 		<label for="rememberme" class="inline">
76 76
 
77
-			<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woothemes-sensei' ); ?>
77
+			<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember me', 'woothemes-sensei'); ?>
78 78
 
79 79
 		</label>
80 80
 
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @since 1.6.2
88 88
      */
89
-        do_action( 'sensei_login_form_inside_after' );
89
+        do_action('sensei_login_form_inside_after');
90 90
     ?>
91 91
 
92
-	<?php wp_nonce_field( 'sensei-login' ); ?>
92
+	<?php wp_nonce_field('sensei-login'); ?>
93 93
 
94
-	<input type="hidden" name="redirect" value="<?php echo esc_url_raw( sensei_get_current_page_url() ) ?>" />
94
+	<input type="hidden" name="redirect" value="<?php echo esc_url_raw(sensei_get_current_page_url()) ?>" />
95 95
 
96 96
 	<input type="hidden" name="form" value="sensei-login" />
97 97
 
@@ -105,5 +105,5 @@  discard block
 block discarded – undo
105 105
  *
106 106
  *  @since 1.9.0
107 107
  */
108
-do_action( 'sensei_login_form_after' );
108
+do_action('sensei_login_form_after');
109 109
 ?>
110 110
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 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 User Profile List Table Class
Please login to merge, or discard this patch.
templates/user/my-courses.php 3 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,61 +1,61 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) exit;
3 3
 /**
4
- * The Template for displaying the my course page data.
5
- *
6
- * Override this template by copying it to yourtheme/sensei/user/my-courses.php
7
- *
8
- * @author 		Automattic
9
- * @package 	Sensei
10
- * @category    Templates
11
- * @version     1.9.0
12
- */
4
+	 * The Template for displaying the my course page data.
5
+	 *
6
+	 * Override this template by copying it to yourtheme/sensei/user/my-courses.php
7
+	 *
8
+	 * @author 		Automattic
9
+	 * @package 	Sensei
10
+	 * @category    Templates
11
+	 * @version     1.9.0
12
+	 */
13 13
 ?>
14 14
 
15 15
 <?php
16 16
 /**
17
- * Executes before the Sensei my courses markup begins. This hook
18
- * only fires whe a user is logged in. If you need to add
19
- * something here for when users are logged out use `sensei_login_form_before`.
20
- *
21
- * @since 1.9.0
22
- */
17
+	 * Executes before the Sensei my courses markup begins. This hook
18
+	 * only fires whe a user is logged in. If you need to add
19
+	 * something here for when users are logged out use `sensei_login_form_before`.
20
+	 *
21
+	 * @since 1.9.0
22
+	 */
23 23
 do_action( 'sensei_my_courses_before' );
24 24
 ?>
25 25
 
26 26
 <section id="main-course" class="course-container">
27 27
 
28 28
     <?php
29
-    /**
30
-     * Executes inside just before the Sensei my courses content. This hook
31
-     * only fires whe a user is logged in.
32
-     *
33
-     * @since 1.9.0
34
-     */
35
-    do_action( 'sensei_my_courses_content_inside_before' );
36
-    ?>
29
+	/**
30
+	 * Executes inside just before the Sensei my courses content. This hook
31
+	 * only fires whe a user is logged in.
32
+	 *
33
+	 * @since 1.9.0
34
+	 */
35
+	do_action( 'sensei_my_courses_content_inside_before' );
36
+	?>
37 37
 
38 38
     <?php sensei_the_my_courses_content(); ?>
39 39
 
40 40
     <?php
41
-    /**
42
-     * Executes inside just after the Sensei my courses content. This hook
43
-     * only fires whe a user is logged in.
44
-     *
45
-     * @since 1.9.0
46
-     */
47
-    do_action( 'sensei_my_courses_content_inside_after' );
48
-    ?>
41
+	/**
42
+	 * Executes inside just after the Sensei my courses content. This hook
43
+	 * only fires whe a user is logged in.
44
+	 *
45
+	 * @since 1.9.0
46
+	 */
47
+	do_action( 'sensei_my_courses_content_inside_after' );
48
+	?>
49 49
 
50 50
 </section>
51 51
 
52 52
 <?php
53 53
 /**
54
- * Executes after the Sensei my courses template markup ends. This hook
55
- * only fires whe a user is logged in. If you need to add
56
- * something here for when users are logged out use `sensei_login_form_after`.
57
- *
58
- * @since 1.9.0
59
- */
54
+	 * Executes after the Sensei my courses template markup ends. This hook
55
+	 * only fires whe a user is logged in. If you need to add
56
+	 * something here for when users are logged out use `sensei_login_form_after`.
57
+	 *
58
+	 * @since 1.9.0
59
+	 */
60 60
 do_action( 'sensei_my_courses_after' );
61 61
 ?>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 /**
4 4
  * The Template for displaying the my course page data.
5 5
  *
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * @since 1.9.0
22 22
  */
23
-do_action( 'sensei_my_courses_before' );
23
+do_action('sensei_my_courses_before');
24 24
 ?>
25 25
 
26 26
 <section id="main-course" class="course-container">
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @since 1.9.0
34 34
      */
35
-    do_action( 'sensei_my_courses_content_inside_before' );
35
+    do_action('sensei_my_courses_content_inside_before');
36 36
     ?>
37 37
 
38 38
     <?php sensei_the_my_courses_content(); ?>
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      *
45 45
      * @since 1.9.0
46 46
      */
47
-    do_action( 'sensei_my_courses_content_inside_after' );
47
+    do_action('sensei_my_courses_content_inside_after');
48 48
     ?>
49 49
 
50 50
 </section>
@@ -57,5 +57,5 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @since 1.9.0
59 59
  */
60
-do_action( 'sensei_my_courses_after' );
60
+do_action('sensei_my_courses_after');
61 61
 ?>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
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
  *
Please login to merge, or discard this patch.
woothemes-sensei.php 3 patches
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -30,80 +30,80 @@
 block discarded – undo
30 30
 
31 31
 	if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
32 32
 
33
-    require_once( 'includes/class-sensei-autoloader.php' );
34
-    require_once( 'includes/lib/woo-functions.php' );
35
-    require_once( 'includes/sensei-functions.php' );
36
-
37
-    if ( ! is_admin() ) {
38
-        require_once( 'includes/template-functions.php' );
39
-    }
40
-
41
-    /**
42
-     * Returns the global Sensei Instance.
43
-     *
44
-     * @since 1.8.0
45
-     */
46
-    function Sensei(){
47
-
48
-        return Sensei_Main::instance();
49
-
50
-    }
51
-
52
-    // set the sensei version number
53
-    Sensei()->version = '1.9-beta';
54
-
55
-    //backwards compatibility
56
-    global $woothemes_sensei;
57
-    $woothemes_sensei = Sensei();
58
-
59
-    /**
60
-    * Hook in WooCommerce functionality
61
-    */
62
-    if( Sensei_WC::is_woocommerce_active() ){
63
-        add_action('init', array( 'Sensei_WC', 'load_woocommerce_integration_hooks' ) );
64
-    }
65
-
66
-    /**
67
-     * Load all Template hooks
68
-    */
69
-    if(! is_admin() ){
70
-
71
-        require_once( 'includes/hooks/template.php' );
72
-
73
-    }
74
-
75
-    /**
76
-     * Plugin updates
77
-     * @since  1.0.1
78
-     */
79
-    woothemes_queue_update( plugin_basename( __FILE__ ), 'bad2a02a063555b7e2bee59924690763', 152116 );
80
-
81
-    /**
82
-     * Sensei Activation Hook registration
83
-     * @since 1.8.0
84
-     */
85
-    register_activation_hook( __FILE__, 'activate_sensei' );
86
-
87
-    /**
88
-     * Activate_sensei
89
-     *
90
-     * All the activation checks needed to ensure Sensei is ready for use
91
-     * @since 1.8.0
92
-     */
93
-    function activate_sensei () {
94
-
95
-        // create the teacher role on activation and ensure that it has all the needed capabilities
96
-        Sensei()->teacher->create_role();
97
-
98
-        //Setup all the role capabilities needed
99
-        Sensei()->updates->add_sensei_caps();
100
-        Sensei()->updates->add_editor_caps();
101
-        Sensei()->updates->assign_role_caps();
102
-
103
-        //Flush rules
104
-        add_action( 'activated_plugin' , array( 'Sensei_Main','activation_flush_rules' ), 10 );
105
-
106
-        //Load the Welcome Screen
107
-        add_action( 'activated_plugin' , array( 'Sensei_Welcome','redirect' ), 20 );
108
-
109
-    }// end activate_sensei
33
+	require_once( 'includes/class-sensei-autoloader.php' );
34
+	require_once( 'includes/lib/woo-functions.php' );
35
+	require_once( 'includes/sensei-functions.php' );
36
+
37
+	if ( ! is_admin() ) {
38
+		require_once( 'includes/template-functions.php' );
39
+	}
40
+
41
+	/**
42
+	 * Returns the global Sensei Instance.
43
+	 *
44
+	 * @since 1.8.0
45
+	 */
46
+	function Sensei(){
47
+
48
+		return Sensei_Main::instance();
49
+
50
+	}
51
+
52
+	// set the sensei version number
53
+	Sensei()->version = '1.9-beta';
54
+
55
+	//backwards compatibility
56
+	global $woothemes_sensei;
57
+	$woothemes_sensei = Sensei();
58
+
59
+	/**
60
+	 * Hook in WooCommerce functionality
61
+	 */
62
+	if( Sensei_WC::is_woocommerce_active() ){
63
+		add_action('init', array( 'Sensei_WC', 'load_woocommerce_integration_hooks' ) );
64
+	}
65
+
66
+	/**
67
+	 * Load all Template hooks
68
+	 */
69
+	if(! is_admin() ){
70
+
71
+		require_once( 'includes/hooks/template.php' );
72
+
73
+	}
74
+
75
+	/**
76
+	 * Plugin updates
77
+	 * @since  1.0.1
78
+	 */
79
+	woothemes_queue_update( plugin_basename( __FILE__ ), 'bad2a02a063555b7e2bee59924690763', 152116 );
80
+
81
+	/**
82
+	 * Sensei Activation Hook registration
83
+	 * @since 1.8.0
84
+	 */
85
+	register_activation_hook( __FILE__, 'activate_sensei' );
86
+
87
+	/**
88
+	 * Activate_sensei
89
+	 *
90
+	 * All the activation checks needed to ensure Sensei is ready for use
91
+	 * @since 1.8.0
92
+	 */
93
+	function activate_sensei () {
94
+
95
+		// create the teacher role on activation and ensure that it has all the needed capabilities
96
+		Sensei()->teacher->create_role();
97
+
98
+		//Setup all the role capabilities needed
99
+		Sensei()->updates->add_sensei_caps();
100
+		Sensei()->updates->add_editor_caps();
101
+		Sensei()->updates->assign_role_caps();
102
+
103
+		//Flush rules
104
+		add_action( 'activated_plugin' , array( 'Sensei_Main','activation_flush_rules' ), 10 );
105
+
106
+		//Load the Welcome Screen
107
+		add_action( 'activated_plugin' , array( 'Sensei_Welcome','redirect' ), 20 );
108
+
109
+	}// end activate_sensei
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
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')) exit; // Exit if accessed directly
32 32
 
33
-    require_once( 'includes/class-sensei-autoloader.php' );
34
-    require_once( 'includes/lib/woo-functions.php' );
35
-    require_once( 'includes/sensei-functions.php' );
33
+    require_once('includes/class-sensei-autoloader.php');
34
+    require_once('includes/lib/woo-functions.php');
35
+    require_once('includes/sensei-functions.php');
36 36
 
37
-    if ( ! is_admin() ) {
38
-        require_once( 'includes/template-functions.php' );
37
+    if ( ! is_admin()) {
38
+        require_once('includes/template-functions.php');
39 39
     }
40 40
 
41 41
     /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      *
44 44
      * @since 1.8.0
45 45
      */
46
-    function Sensei(){
46
+    function Sensei() {
47 47
 
48 48
         return Sensei_Main::instance();
49 49
 
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
     /**
60 60
     * Hook in WooCommerce functionality
61 61
     */
62
-    if( Sensei_WC::is_woocommerce_active() ){
63
-        add_action('init', array( 'Sensei_WC', 'load_woocommerce_integration_hooks' ) );
62
+    if (Sensei_WC::is_woocommerce_active()) {
63
+        add_action('init', array('Sensei_WC', 'load_woocommerce_integration_hooks'));
64 64
     }
65 65
 
66 66
     /**
67 67
      * Load all Template hooks
68 68
     */
69
-    if(! is_admin() ){
69
+    if ( ! is_admin()) {
70 70
 
71
-        require_once( 'includes/hooks/template.php' );
71
+        require_once('includes/hooks/template.php');
72 72
 
73 73
     }
74 74
 
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
      * Plugin updates
77 77
      * @since  1.0.1
78 78
      */
79
-    woothemes_queue_update( plugin_basename( __FILE__ ), 'bad2a02a063555b7e2bee59924690763', 152116 );
79
+    woothemes_queue_update(plugin_basename(__FILE__), 'bad2a02a063555b7e2bee59924690763', 152116);
80 80
 
81 81
     /**
82 82
      * Sensei Activation Hook registration
83 83
      * @since 1.8.0
84 84
      */
85
-    register_activation_hook( __FILE__, 'activate_sensei' );
85
+    register_activation_hook(__FILE__, 'activate_sensei');
86 86
 
87 87
     /**
88 88
      * Activate_sensei
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * All the activation checks needed to ensure Sensei is ready for use
91 91
      * @since 1.8.0
92 92
      */
93
-    function activate_sensei () {
93
+    function activate_sensei() {
94 94
 
95 95
         // create the teacher role on activation and ensure that it has all the needed capabilities
96 96
         Sensei()->teacher->create_role();
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         Sensei()->updates->assign_role_caps();
102 102
 
103 103
         //Flush rules
104
-        add_action( 'activated_plugin' , array( 'Sensei_Main','activation_flush_rules' ), 10 );
104
+        add_action('activated_plugin', array('Sensei_Main', 'activation_flush_rules'), 10);
105 105
 
106 106
         //Load the Welcome Screen
107
-        add_action( 'activated_plugin' , array( 'Sensei_Welcome','redirect' ), 20 );
107
+        add_action('activated_plugin', array('Sensei_Welcome', 'redirect'), 20);
108 108
 
109 109
     }// end activate_sensei
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,10 @@
 block discarded – undo
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' );
Please login to merge, or discard this patch.
includes/class-sensei-course-results.php 3 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 class Sensei_Course_Results {
16 16
 
17 17
 	public $token;
18
-    public  $courses_url_base;
18
+	public  $courses_url_base;
19 19
 
20 20
 	/**
21 21
 	 * Constructor.
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		global $wp_query,  $current_user;
97 97
 
98 98
 		if( isset( $wp_query->query_vars['course_results'] ) ) {
99
-            Sensei_Templates::get_template( 'course-results/course-info.php' );
99
+			Sensei_Templates::get_template( 'course-results/course-info.php' );
100 100
 		}
101 101
 
102 102
 	}
@@ -115,20 +115,20 @@  discard block
 block discarded – undo
115 115
 
116 116
 		sensei_do_deprecated_action( 'sensei_course_results_lessons','1.9.','sensei_course_results_content_inside_after', $course );
117 117
 
118
-        sensei_do_deprecated_action( 'sensei_course_results_bottom','1.9.','sensei_course_results_content_inside_after', $course->ID );
118
+		sensei_do_deprecated_action( 'sensei_course_results_bottom','1.9.','sensei_course_results_content_inside_after', $course->ID );
119 119
 
120 120
 	}
121 121
 
122 122
 	/**
123 123
 	 * Load template for displaying course lessons
124
-     *
124
+	 *
125 125
 	 * @since  1.4.0
126 126
 	 * @return void
127 127
 	 */
128 128
 	public function course_lessons() {
129 129
 
130 130
 		global $course;
131
-        _deprecated_function( 'Sensei_modules course_lessons ', '1.9.0' );
131
+		_deprecated_function( 'Sensei_modules course_lessons ', '1.9.0' );
132 132
 
133 133
 	}
134 134
 
@@ -145,62 +145,62 @@  discard block
 block discarded – undo
145 145
 		return $classes;
146 146
 	}
147 147
 
148
-    /**
149
-     * Deprecate the sensei_course_results_content hook
150
-     *
151
-     * @deprecated since 1.9.0
152
-     */
153
-    public static function deprecate_sensei_course_results_content_hook(){
148
+	/**
149
+	 * Deprecate the sensei_course_results_content hook
150
+	 *
151
+	 * @deprecated since 1.9.0
152
+	 */
153
+	public static function deprecate_sensei_course_results_content_hook(){
154 154
 
155
-        sensei_do_deprecated_action('sensei_course_results_content', '1.9.0','sensei_course_results_content_before');
155
+		sensei_do_deprecated_action('sensei_course_results_content', '1.9.0','sensei_course_results_content_before');
156 156
 
157
-    }
157
+	}
158 158
 
159
-    /**
160
-     * Fire the sensei frontend message hook
161
-     *
162
-     * @since 1.9.0
163
-     */
164
-    public static function fire_sensei_message_hook(){
159
+	/**
160
+	 * Fire the sensei frontend message hook
161
+	 *
162
+	 * @since 1.9.0
163
+	 */
164
+	public static function fire_sensei_message_hook(){
165 165
 
166
-        do_action( 'sensei_frontend_messages' );
166
+		do_action( 'sensei_frontend_messages' );
167 167
 
168
-    }
168
+	}
169 169
 
170
-    /**
171
-     * Deprecate the course_results info hook
172
-     *
173
-     * @since 1.9.0
174
-     */
175
-    public static function deprecate_course_result_info_hook(){
170
+	/**
171
+	 * Deprecate the course_results info hook
172
+	 *
173
+	 * @since 1.9.0
174
+	 */
175
+	public static function deprecate_course_result_info_hook(){
176 176
 
177
-        sensei_do_deprecated_action( 'sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before' );
177
+		sensei_do_deprecated_action( 'sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before' );
178 178
 
179
-    }
179
+	}
180 180
 
181
-    /**
182
-     * Deprecate the sensei_course_results_top hook
183
-     *
184
-     * @deprecate since 1.9.0
185
-     */
186
-    public static function deprecate_course_results_top_hook(){
181
+	/**
182
+	 * Deprecate the sensei_course_results_top hook
183
+	 *
184
+	 * @deprecate since 1.9.0
185
+	 */
186
+	public static function deprecate_course_results_top_hook(){
187 187
 
188
-        global $course;
189
-        sensei_do_deprecated_action( 'sensei_course_results_top', '1.9.0' ,'sensei_course_results_content_inside_before',$course->ID );
188
+		global $course;
189
+		sensei_do_deprecated_action( 'sensei_course_results_top', '1.9.0' ,'sensei_course_results_content_inside_before',$course->ID );
190 190
 
191
-    }
191
+	}
192 192
 
193
-    /**
194
-     * Fire the course image hook
195
-     *
196
-     * @since 1.8.0
197
-     */
198
-    public static function fire_course_image_hook(){
193
+	/**
194
+	 * Fire the course image hook
195
+	 *
196
+	 * @since 1.8.0
197
+	 */
198
+	public static function fire_course_image_hook(){
199 199
 
200
-        global $course;
201
-        do_action( 'sensei_course_image', $course->ID );
200
+		global $course;
201
+		do_action( 'sensei_course_image', $course->ID );
202 202
 
203
-    }
203
+	}
204 204
 
205 205
 } // End Class
206 206
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 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 User Profile List Table Class
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Sensei Course Results Class
@@ -21,20 +21,20 @@  discard block
 block discarded – undo
21 21
 	 * Constructor.
22 22
 	 * @since  1.4.0
23 23
 	 */
24
-	public function __construct () {
24
+	public function __construct() {
25 25
 
26 26
 		// Setup learner profile URL base
27
-		$this->courses_url_base = apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url slug', 'woothemes-sensei' ) );
27
+		$this->courses_url_base = apply_filters('sensei_course_slug', _x('course', 'post type single url slug', 'woothemes-sensei'));
28 28
 
29 29
 		// Setup permalink structure for course results
30
-		add_action( 'init', array( $this, 'setup_permastruct' ) );
31
-		add_filter( 'wp_title', array( $this, 'page_title' ), 10, 2 );
30
+		add_action('init', array($this, 'setup_permastruct'));
31
+		add_filter('wp_title', array($this, 'page_title'), 10, 2);
32 32
 
33 33
 		// Load course results
34
-		add_action( 'sensei_course_results_content_inside_before', array( $this, 'deprecate_course_result_info_hook' ), 10 );
34
+		add_action('sensei_course_results_content_inside_before', array($this, 'deprecate_course_result_info_hook'), 10);
35 35
 
36 36
 		// Add class to body tag
37
-		add_filter( 'body_class', array( $this, 'body_class' ), 10, 1 );
37
+		add_filter('body_class', array($this, 'body_class'), 10, 1);
38 38
 
39 39
 	} // End __construct()
40 40
 
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	 * @return void
45 45
 	 */
46 46
 	public function setup_permastruct() {
47
-		add_rewrite_rule( '^' . $this->courses_url_base . '/([^/]*)/results/?', 'index.php?course_results=$matches[1]', 'top' );
48
-		add_rewrite_tag( '%course_results%', '([^&]+)' );
47
+		add_rewrite_rule('^'.$this->courses_url_base.'/([^/]*)/results/?', 'index.php?course_results=$matches[1]', 'top');
48
+		add_rewrite_tag('%course_results%', '([^&]+)');
49 49
 	}
50 50
 
51 51
 	/**
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	 * @param  string $sep   Seeparator string
55 55
 	 * @return string        Modified title
56 56
 	 */
57
-	public function page_title( $title, $sep = null ) {
57
+	public function page_title($title, $sep = null) {
58 58
 		global $wp_query;
59
-		if( isset( $wp_query->query_vars['course_results'] ) ) {
60
-			$course = get_page_by_path( $wp_query->query_vars['course_results'], OBJECT, 'course' );
61
-			$title = __( 'Course Results: ', 'woothemes-sensei' ) . $course->post_title . ' ' . $sep . ' ';
59
+		if (isset($wp_query->query_vars['course_results'])) {
60
+			$course = get_page_by_path($wp_query->query_vars['course_results'], OBJECT, 'course');
61
+			$title = __('Course Results: ', 'woothemes-sensei').$course->post_title.' '.$sep.' ';
62 62
 		}
63 63
 		return $title;
64 64
 	}
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
 	 * @param  integer $course_id ID of course
70 70
 	 * @return string             The course results page permalink
71 71
 	 */
72
-	public function get_permalink( $course_id = 0 ) {
72
+	public function get_permalink($course_id = 0) {
73 73
 
74 74
 		$permalink = '';
75 75
 
76
-		if( $course_id > 0 ) {
76
+		if ($course_id > 0) {
77 77
 
78
-			$course = get_post( $course_id );
78
+			$course = get_post($course_id);
79 79
 
80
-			if ( get_option('permalink_structure') ) {
81
-				$permalink = trailingslashit( get_home_url() ) . $this->courses_url_base . '/' . $course->post_name . '/results/';
80
+			if (get_option('permalink_structure')) {
81
+				$permalink = trailingslashit(get_home_url()).$this->courses_url_base.'/'.$course->post_name.'/results/';
82 82
 			} else {
83
-				$permalink = trailingslashit( get_home_url() ) . '?course_results=' . $course->post_name;
83
+				$permalink = trailingslashit(get_home_url()).'?course_results='.$course->post_name;
84 84
 			}
85 85
 		}
86 86
 
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 	 * @return void
94 94
 	 */
95 95
 	public function content() {
96
-		global $wp_query,  $current_user;
96
+		global $wp_query, $current_user;
97 97
 
98
-		if( isset( $wp_query->query_vars['course_results'] ) ) {
99
-            Sensei_Templates::get_template( 'course-results/course-info.php' );
98
+		if (isset($wp_query->query_vars['course_results'])) {
99
+            Sensei_Templates::get_template('course-results/course-info.php');
100 100
 		}
101 101
 
102 102
 	}
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 
111 111
 		global $course;
112 112
 
113
-		$course_status = Sensei_Utils::sensei_user_course_status_message( $course->ID, get_current_user_id());
114
-		echo '<div class="sensei-message ' . $course_status['box_class'] . '">' . $course_status['message'] . '</div>';
113
+		$course_status = Sensei_Utils::sensei_user_course_status_message($course->ID, get_current_user_id());
114
+		echo '<div class="sensei-message '.$course_status['box_class'].'">'.$course_status['message'].'</div>';
115 115
 
116
-		sensei_do_deprecated_action( 'sensei_course_results_lessons','1.9.','sensei_course_results_content_inside_after', $course );
116
+		sensei_do_deprecated_action('sensei_course_results_lessons', '1.9.', 'sensei_course_results_content_inside_after', $course);
117 117
 
118
-        sensei_do_deprecated_action( 'sensei_course_results_bottom','1.9.','sensei_course_results_content_inside_after', $course->ID );
118
+        sensei_do_deprecated_action('sensei_course_results_bottom', '1.9.', 'sensei_course_results_content_inside_after', $course->ID);
119 119
 
120 120
 	}
121 121
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	public function course_lessons() {
129 129
 
130 130
 		global $course;
131
-        _deprecated_function( 'Sensei_modules course_lessons ', '1.9.0' );
131
+        _deprecated_function('Sensei_modules course_lessons ', '1.9.0');
132 132
 
133 133
 	}
134 134
 
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
 	 * @param  array $classes Existing classes
138 138
 	 * @return array          Modified classes
139 139
 	 */
140
-	public function body_class( $classes ) {
140
+	public function body_class($classes) {
141 141
 		global $wp_query;
142
-		if( isset( $wp_query->query_vars['course_results'] ) ) {
142
+		if (isset($wp_query->query_vars['course_results'])) {
143 143
 			$classes[] = 'course-results';
144 144
 		}
145 145
 		return $classes;
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
      *
151 151
      * @deprecated since 1.9.0
152 152
      */
153
-    public static function deprecate_sensei_course_results_content_hook(){
153
+    public static function deprecate_sensei_course_results_content_hook() {
154 154
 
155
-        sensei_do_deprecated_action('sensei_course_results_content', '1.9.0','sensei_course_results_content_before');
155
+        sensei_do_deprecated_action('sensei_course_results_content', '1.9.0', 'sensei_course_results_content_before');
156 156
 
157 157
     }
158 158
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
      *
162 162
      * @since 1.9.0
163 163
      */
164
-    public static function fire_sensei_message_hook(){
164
+    public static function fire_sensei_message_hook() {
165 165
 
166
-        do_action( 'sensei_frontend_messages' );
166
+        do_action('sensei_frontend_messages');
167 167
 
168 168
     }
169 169
 
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
      *
173 173
      * @since 1.9.0
174 174
      */
175
-    public static function deprecate_course_result_info_hook(){
175
+    public static function deprecate_course_result_info_hook() {
176 176
 
177
-        sensei_do_deprecated_action( 'sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before' );
177
+        sensei_do_deprecated_action('sensei_course_results_info', '1.9.0', 'sensei_course_results_content_inside_before');
178 178
 
179 179
     }
180 180
 
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
      *
184 184
      * @deprecate since 1.9.0
185 185
      */
186
-    public static function deprecate_course_results_top_hook(){
186
+    public static function deprecate_course_results_top_hook() {
187 187
 
188 188
         global $course;
189
-        sensei_do_deprecated_action( 'sensei_course_results_top', '1.9.0' ,'sensei_course_results_content_inside_before',$course->ID );
189
+        sensei_do_deprecated_action('sensei_course_results_top', '1.9.0', 'sensei_course_results_content_inside_before', $course->ID);
190 190
 
191 191
     }
192 192
 
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
      *
196 196
      * @since 1.8.0
197 197
      */
198
-    public static function fire_course_image_hook(){
198
+    public static function fire_course_image_hook() {
199 199
 
200 200
         global $course;
201
-        do_action( 'sensei_course_image', $course->ID );
201
+        do_action('sensei_course_image', $course->ID);
202 202
 
203 203
     }
204 204
 
@@ -209,4 +209,4 @@  discard block
 block discarded – undo
209 209
  * for backward compatibility
210 210
  * @since 1.9.0
211 211
  */
212
-class WooThemes_Sensei_Course_Results extends Sensei_Course_Results{}
212
+class WooThemes_Sensei_Course_Results extends Sensei_Course_Results {}
Please login to merge, or discard this patch.
includes/shortcodes/class-sensei-shortcode-courses.php 3 patches
Indentation   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -14,205 +14,205 @@
 block discarded – undo
14 14
  */
15 15
 class Sensei_Shortcode_Courses implements Sensei_Shortcode_Interface {
16 16
 
17
-    /**
18
-     * @var WP_Query to help setup the query needed by the render method.
19
-     */
20
-    protected $query;
21
-
22
-    /**
23
-     * @var string number of items to show on the current page
24
-     * Default: -1.
25
-     */
26
-    protected $number;
27
-
28
-    /**
29
-     * @var string ordery by course field
30
-     * Default: date
31
-     */
32
-    protected $orderby;
33
-
34
-    /**
35
-     * @var string ASC or DESC
36
-     * Default: 'DESC'
37
-     */
38
-    protected  $order;
17
+	/**
18
+	 * @var WP_Query to help setup the query needed by the render method.
19
+	 */
20
+	protected $query;
21
+
22
+	/**
23
+	 * @var string number of items to show on the current page
24
+	 * Default: -1.
25
+	 */
26
+	protected $number;
27
+
28
+	/**
29
+	 * @var string ordery by course field
30
+	 * Default: date
31
+	 */
32
+	protected $orderby;
33
+
34
+	/**
35
+	 * @var string ASC or DESC
36
+	 * Default: 'DESC'
37
+	 */
38
+	protected  $order;
39 39
 
40
-    /**
41
-     * @var category can be completed or active or all
42
-     */
43
-    protected $category;
44
-
45
-    /**
46
-     * @var string teacher id to limit the courses to
47
-     */
48
-    protected $teacher;
40
+	/**
41
+	 * @var category can be completed or active or all
42
+	 */
43
+	protected $category;
44
+
45
+	/**
46
+	 * @var string teacher id to limit the courses to
47
+	 */
48
+	protected $teacher;
49 49
 
50
-    /**
51
-     * @var string csv of course ids to limit the search to
52
-     */
53
-    protected $ids;
50
+	/**
51
+	 * @var string csv of course ids to limit the search to
52
+	 */
53
+	protected $ids;
54 54
 
55
-    /**
56
-     * @var exclude courses by id
57
-     */
58
-    protected $exclude;
55
+	/**
56
+	 * @var exclude courses by id
57
+	 */
58
+	protected $exclude;
59 59
 
60
-    /**
61
-     * Setup the shortcode object
62
-     *
63
-     * @since 1.9.0
64
-     * @param array $attributes
65
-     * @param string $content
66
-     * @param string $shortcode the shortcode that was called for this instance
67
-     */
68
-    public function __construct( $attributes, $content, $shortcode ){
60
+	/**
61
+	 * Setup the shortcode object
62
+	 *
63
+	 * @since 1.9.0
64
+	 * @param array $attributes
65
+	 * @param string $content
66
+	 * @param string $shortcode the shortcode that was called for this instance
67
+	 */
68
+	public function __construct( $attributes, $content, $shortcode ){
69 69
 
70
-        // set up all argument need for constructing the course query
71
-        $this->number = isset( $attributes['number'] ) ? $attributes['number'] : '10';
72
-        $this->teacher = isset( $attributes['teacher'] ) ? $attributes['teacher'] : '';
73
-        $this->orderby = isset( $attributes['orderby'] ) ? $attributes['orderby'] : 'date';
70
+		// set up all argument need for constructing the course query
71
+		$this->number = isset( $attributes['number'] ) ? $attributes['number'] : '10';
72
+		$this->teacher = isset( $attributes['teacher'] ) ? $attributes['teacher'] : '';
73
+		$this->orderby = isset( $attributes['orderby'] ) ? $attributes['orderby'] : 'date';
74 74
 
75
-        // set the default for menu_order to be ASC
76
-        if( 'menu_order' == $this->orderby && !isset( $attributes['order']  ) ){
75
+		// set the default for menu_order to be ASC
76
+		if( 'menu_order' == $this->orderby && !isset( $attributes['order']  ) ){
77 77
 
78
-            $this->order =  'ASC';
78
+			$this->order =  'ASC';
79 79
 
80
-        }else{
80
+		}else{
81 81
 
82
-            // for everything else use the value passed or the default DESC
83
-            $this->order = isset( $attributes['order']  ) ? $attributes['order'] : 'DESC';
82
+			// for everything else use the value passed or the default DESC
83
+			$this->order = isset( $attributes['order']  ) ? $attributes['order'] : 'DESC';
84 84
 
85
-        }
85
+		}
86 86
 
87
-        $category = isset( $attributes['category'] ) ? $attributes['category'] : '';
88
-        $this->category = is_numeric( $category ) ? intval( $category ) : $category;
87
+		$category = isset( $attributes['category'] ) ? $attributes['category'] : '';
88
+		$this->category = is_numeric( $category ) ? intval( $category ) : $category;
89 89
 
90
-        $ids =  isset( $attributes['ids'] ) ? $attributes['ids'] : '';
91
-        $this->ids = empty( $ids ) ? '' : explode( ',', $ids );
90
+		$ids =  isset( $attributes['ids'] ) ? $attributes['ids'] : '';
91
+		$this->ids = empty( $ids ) ? '' : explode( ',', $ids );
92 92
 
93
-        $exclude =  isset( $attributes['exclude'] ) ? $attributes['exclude'] : '';
94
-        $this->exclude = empty( $exclude ) ? '' : explode( ',', $exclude );
93
+		$exclude =  isset( $attributes['exclude'] ) ? $attributes['exclude'] : '';
94
+		$this->exclude = empty( $exclude ) ? '' : explode( ',', $exclude );
95 95
 
96
-        // setup the course query that will be used when rendering
97
-        $this->setup_course_query();
98
-    }
96
+		// setup the course query that will be used when rendering
97
+		$this->setup_course_query();
98
+	}
99 99
 
100
-    /**
101
-     * Sets up the object course query
102
-     * that will be used int he render method.
103
-     *
104
-     * @since 1.9.0
105
-     */
106
-    protected function setup_course_query(){
100
+	/**
101
+	 * Sets up the object course query
102
+	 * that will be used int he render method.
103
+	 *
104
+	 * @since 1.9.0
105
+	 */
106
+	protected function setup_course_query(){
107 107
 
108
-        // query defaults
109
-        $query_args = array(
110
-            'post_type'        => 'course',
111
-            'post_status'      => 'publish',
112
-            'orderby'          => $this->orderby,
113
-            'order'            => $this->order,
114
-            'posts_per_page'   => $this->number,
108
+		// query defaults
109
+		$query_args = array(
110
+			'post_type'        => 'course',
111
+			'post_status'      => 'publish',
112
+			'orderby'          => $this->orderby,
113
+			'order'            => $this->order,
114
+			'posts_per_page'   => $this->number,
115 115
 
116
-        );
116
+		);
117 117
 
118
-        // setup the teacher query if any teacher was specified
119
-        if( !empty( $this->teacher )){
118
+		// setup the teacher query if any teacher was specified
119
+		if( !empty( $this->teacher )){
120 120
 
121
-            // when users passed in a csv
122
-            if( strpos( $this->teacher, ',' ) ){
121
+			// when users passed in a csv
122
+			if( strpos( $this->teacher, ',' ) ){
123 123
 
124
-                $teachers = explode( ',', $this->teacher );
124
+				$teachers = explode( ',', $this->teacher );
125 125
 
126
-                // for all user names given convert them to user ID's
127
-                foreach( $teachers as $index => $teacher  ){
126
+				// for all user names given convert them to user ID's
127
+				foreach( $teachers as $index => $teacher  ){
128 128
 
129
-                    //replace the teacher value with the teachers ID
130
-                    if( ! is_numeric( $teacher ) ){
129
+					//replace the teacher value with the teachers ID
130
+					if( ! is_numeric( $teacher ) ){
131 131
 
132
-                        $user = get_user_by('login', $teacher);
133
-                        $teachers[$index] = $user->ID;
132
+						$user = get_user_by('login', $teacher);
133
+						$teachers[$index] = $user->ID;
134 134
 
135
-                    }
135
+					}
136 136
 
137
-                } // end for each
137
+				} // end for each
138 138
 
139
-                $teacher_query_by = 'author__in';
140
-                $this->teacher = $teachers;
139
+				$teacher_query_by = 'author__in';
140
+				$this->teacher = $teachers;
141 141
 
142
-            }else{
143
-                // when users passed in a single teacher value
144
-                $teacher_query_by = is_numeric( $this->teacher )? 'author':'author_name';
142
+			}else{
143
+				// when users passed in a single teacher value
144
+				$teacher_query_by = is_numeric( $this->teacher )? 'author':'author_name';
145 145
 
146
-            }
146
+			}
147 147
 
148
-            // attach teacher query by and teacher query value to the course query
149
-            $query_args[ $teacher_query_by ] = $this->teacher;
148
+			// attach teacher query by and teacher query value to the course query
149
+			$query_args[ $teacher_query_by ] = $this->teacher;
150 150
 
151
-        }// end if empty teacher
151
+		}// end if empty teacher
152 152
 
153 153
 
154
-        // add the course category taxonomy query
155
-        if( ! empty( $this->category ) ) {
154
+		// add the course category taxonomy query
155
+		if( ! empty( $this->category ) ) {
156 156
 
157
-            $tax_query = array();
158
-            $term_id = intval( term_exists($this->category) );
157
+			$tax_query = array();
158
+			$term_id = intval( term_exists($this->category) );
159 159
 
160
-            if (! empty( $term_id) ) {
160
+			if (! empty( $term_id) ) {
161 161
 
162
-                $tax_query = array(
163
-                    'taxonomy' => 'course-category',
164
-                    'field' => 'id',
165
-                    'terms' => $term_id,
166
-                );
162
+				$tax_query = array(
163
+					'taxonomy' => 'course-category',
164
+					'field' => 'id',
165
+					'terms' => $term_id,
166
+				);
167 167
 
168
-            }
168
+			}
169 169
 
170
-            $query_args['tax_query'] = array($tax_query);
170
+			$query_args['tax_query'] = array($tax_query);
171 171
 
172
-        }
172
+		}
173 173
 
174
-        // limit the query if the user supplied ids
175
-        if( ! empty( $this->ids ) && is_array( $this->ids ) ) {
174
+		// limit the query if the user supplied ids
175
+		if( ! empty( $this->ids ) && is_array( $this->ids ) ) {
176 176
 
177
-            $query_args['post__in'] = $this->ids;
177
+			$query_args['post__in'] = $this->ids;
178 178
 
179
-        }
179
+		}
180 180
 
181
-        // exclude the course by id fromt he query
182
-        if( ! empty( $this->exclude ) && is_array( $this->exclude ) ) {
181
+		// exclude the course by id fromt he query
182
+		if( ! empty( $this->exclude ) && is_array( $this->exclude ) ) {
183 183
 
184
-            $query_args['post__not_in'] = $this->exclude;
184
+			$query_args['post__not_in'] = $this->exclude;
185 185
 
186
-        }
186
+		}
187 187
 
188
-        $this->query = new WP_Query( $query_args );
188
+		$this->query = new WP_Query( $query_args );
189 189
 
190
-    }// end setup _course_query
190
+	}// end setup _course_query
191 191
 
192
-    /**
193
-     * Rendering the shortcode this class is responsible for.
194
-     *
195
-     * @return string $content
196
-     */
197
-    public function render(){
192
+	/**
193
+	 * Rendering the shortcode this class is responsible for.
194
+	 *
195
+	 * @return string $content
196
+	 */
197
+	public function render(){
198 198
 
199
-        global $wp_query;
199
+		global $wp_query;
200 200
 
201
-        // keep a reference to old query
202
-        $current_global_query = $wp_query;
201
+		// keep a reference to old query
202
+		$current_global_query = $wp_query;
203 203
 
204
-        // assign the query setup in $this-> setup_course_query
205
-        $wp_query = $this->query;
204
+		// assign the query setup in $this-> setup_course_query
205
+		$wp_query = $this->query;
206 206
 
207
-        ob_start();
208
-        Sensei_Templates::get_template('loop-course.php');
209
-        $shortcode_output =  ob_get_clean();
207
+		ob_start();
208
+		Sensei_Templates::get_template('loop-course.php');
209
+		$shortcode_output =  ob_get_clean();
210 210
 
211
-        //restore old query
212
-        $wp_query = $current_global_query;
211
+		//restore old query
212
+		$wp_query = $current_global_query;
213 213
 
214
-        return $shortcode_output;
214
+		return $shortcode_output;
215 215
 
216
-    }// end render
216
+	}// end render
217 217
 
218 218
 }
219 219
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly
3 3
 /**
4 4
  *
5 5
  * Renders the [sensei_courses] shortcode
@@ -65,33 +65,33 @@  discard block
 block discarded – undo
65 65
      * @param string $content
66 66
      * @param string $shortcode the shortcode that was called for this instance
67 67
      */
68
-    public function __construct( $attributes, $content, $shortcode ){
68
+    public function __construct($attributes, $content, $shortcode) {
69 69
 
70 70
         // set up all argument need for constructing the course query
71
-        $this->number = isset( $attributes['number'] ) ? $attributes['number'] : '10';
72
-        $this->teacher = isset( $attributes['teacher'] ) ? $attributes['teacher'] : '';
73
-        $this->orderby = isset( $attributes['orderby'] ) ? $attributes['orderby'] : 'date';
71
+        $this->number = isset($attributes['number']) ? $attributes['number'] : '10';
72
+        $this->teacher = isset($attributes['teacher']) ? $attributes['teacher'] : '';
73
+        $this->orderby = isset($attributes['orderby']) ? $attributes['orderby'] : 'date';
74 74
 
75 75
         // set the default for menu_order to be ASC
76
-        if( 'menu_order' == $this->orderby && !isset( $attributes['order']  ) ){
76
+        if ('menu_order' == $this->orderby && ! isset($attributes['order'])) {
77 77
 
78
-            $this->order =  'ASC';
78
+            $this->order = 'ASC';
79 79
 
80
-        }else{
80
+        } else {
81 81
 
82 82
             // for everything else use the value passed or the default DESC
83
-            $this->order = isset( $attributes['order']  ) ? $attributes['order'] : 'DESC';
83
+            $this->order = isset($attributes['order']) ? $attributes['order'] : 'DESC';
84 84
 
85 85
         }
86 86
 
87
-        $category = isset( $attributes['category'] ) ? $attributes['category'] : '';
88
-        $this->category = is_numeric( $category ) ? intval( $category ) : $category;
87
+        $category = isset($attributes['category']) ? $attributes['category'] : '';
88
+        $this->category = is_numeric($category) ? intval($category) : $category;
89 89
 
90
-        $ids =  isset( $attributes['ids'] ) ? $attributes['ids'] : '';
91
-        $this->ids = empty( $ids ) ? '' : explode( ',', $ids );
90
+        $ids = isset($attributes['ids']) ? $attributes['ids'] : '';
91
+        $this->ids = empty($ids) ? '' : explode(',', $ids);
92 92
 
93
-        $exclude =  isset( $attributes['exclude'] ) ? $attributes['exclude'] : '';
94
-        $this->exclude = empty( $exclude ) ? '' : explode( ',', $exclude );
93
+        $exclude = isset($attributes['exclude']) ? $attributes['exclude'] : '';
94
+        $this->exclude = empty($exclude) ? '' : explode(',', $exclude);
95 95
 
96 96
         // setup the course query that will be used when rendering
97 97
         $this->setup_course_query();
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @since 1.9.0
105 105
      */
106
-    protected function setup_course_query(){
106
+    protected function setup_course_query() {
107 107
 
108 108
         // query defaults
109 109
         $query_args = array(
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
         );
117 117
 
118 118
         // setup the teacher query if any teacher was specified
119
-        if( !empty( $this->teacher )){
119
+        if ( ! empty($this->teacher)) {
120 120
 
121 121
             // when users passed in a csv
122
-            if( strpos( $this->teacher, ',' ) ){
122
+            if (strpos($this->teacher, ',')) {
123 123
 
124
-                $teachers = explode( ',', $this->teacher );
124
+                $teachers = explode(',', $this->teacher);
125 125
 
126 126
                 // for all user names given convert them to user ID's
127
-                foreach( $teachers as $index => $teacher  ){
127
+                foreach ($teachers as $index => $teacher) {
128 128
 
129 129
                     //replace the teacher value with the teachers ID
130
-                    if( ! is_numeric( $teacher ) ){
130
+                    if ( ! is_numeric($teacher)) {
131 131
 
132 132
                         $user = get_user_by('login', $teacher);
133 133
                         $teachers[$index] = $user->ID;
@@ -139,25 +139,25 @@  discard block
 block discarded – undo
139 139
                 $teacher_query_by = 'author__in';
140 140
                 $this->teacher = $teachers;
141 141
 
142
-            }else{
142
+            } else {
143 143
                 // when users passed in a single teacher value
144
-                $teacher_query_by = is_numeric( $this->teacher )? 'author':'author_name';
144
+                $teacher_query_by = is_numeric($this->teacher) ? 'author' : 'author_name';
145 145
 
146 146
             }
147 147
 
148 148
             // attach teacher query by and teacher query value to the course query
149
-            $query_args[ $teacher_query_by ] = $this->teacher;
149
+            $query_args[$teacher_query_by] = $this->teacher;
150 150
 
151 151
         }// end if empty teacher
152 152
 
153 153
 
154 154
         // add the course category taxonomy query
155
-        if( ! empty( $this->category ) ) {
155
+        if ( ! empty($this->category)) {
156 156
 
157 157
             $tax_query = array();
158
-            $term_id = intval( term_exists($this->category) );
158
+            $term_id = intval(term_exists($this->category));
159 159
 
160
-            if (! empty( $term_id) ) {
160
+            if ( ! empty($term_id)) {
161 161
 
162 162
                 $tax_query = array(
163 163
                     'taxonomy' => 'course-category',
@@ -172,20 +172,20 @@  discard block
 block discarded – undo
172 172
         }
173 173
 
174 174
         // limit the query if the user supplied ids
175
-        if( ! empty( $this->ids ) && is_array( $this->ids ) ) {
175
+        if ( ! empty($this->ids) && is_array($this->ids)) {
176 176
 
177 177
             $query_args['post__in'] = $this->ids;
178 178
 
179 179
         }
180 180
 
181 181
         // exclude the course by id fromt he query
182
-        if( ! empty( $this->exclude ) && is_array( $this->exclude ) ) {
182
+        if ( ! empty($this->exclude) && is_array($this->exclude)) {
183 183
 
184 184
             $query_args['post__not_in'] = $this->exclude;
185 185
 
186 186
         }
187 187
 
188
-        $this->query = new WP_Query( $query_args );
188
+        $this->query = new WP_Query($query_args);
189 189
 
190 190
     }// end setup _course_query
191 191
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      *
195 195
      * @return string $content
196 196
      */
197
-    public function render(){
197
+    public function render() {
198 198
 
199 199
         global $wp_query;
200 200
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
         ob_start();
208 208
         Sensei_Templates::get_template('loop-course.php');
209
-        $shortcode_output =  ob_get_clean();
209
+        $shortcode_output = ob_get_clean();
210 210
 
211 211
         //restore old query
212 212
         $wp_query = $current_global_query;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 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
  * Renders the [sensei_courses] shortcode
@@ -77,7 +80,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/shortcodes/class-sensei-shortcode-lesson-page.php 3 patches
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -14,88 +14,88 @@
 block discarded – undo
14 14
  */
15 15
 class Sensei_Shortcode_Lesson_Page implements Sensei_Shortcode_Interface {
16 16
 
17
-    /**
18
-     * @var array $lesson_page_query {
19
-     *     @type WP_Post
20
-     * }
21
-     * The lessons query
22
-     */
23
-    protected $lesson_page_query;
17
+	/**
18
+	 * @var array $lesson_page_query {
19
+	 *     @type WP_Post
20
+	 * }
21
+	 * The lessons query
22
+	 */
23
+	protected $lesson_page_query;
24 24
 
25
-    /**
26
-     * Setup the shortcode object
27
-     *
28
-     * @since 1.9.0
29
-     * @param array $attributes
30
-     * @param string $content
31
-     * @param string $shortcode the shortcode that was called for this instance
32
-     */
33
-    public function __construct( $attributes, $content, $shortcode ){
25
+	/**
26
+	 * Setup the shortcode object
27
+	 *
28
+	 * @since 1.9.0
29
+	 * @param array $attributes
30
+	 * @param string $content
31
+	 * @param string $shortcode the shortcode that was called for this instance
32
+	 */
33
+	public function __construct( $attributes, $content, $shortcode ){
34 34
 
35
-        $this->id = isset( $attributes['id'] ) ? $attributes['id'] : '';
36
-        $this->setup_lesson_query();
35
+		$this->id = isset( $attributes['id'] ) ? $attributes['id'] : '';
36
+		$this->setup_lesson_query();
37 37
 
38
-    }
38
+	}
39 39
 
40
-    /**
41
-     * create the lessons query .
42
-     *
43
-     * @return mixed
44
-     */
45
-    public function setup_lesson_query(){
40
+	/**
41
+	 * create the lessons query .
42
+	 *
43
+	 * @return mixed
44
+	 */
45
+	public function setup_lesson_query(){
46 46
 
47
-        if( empty( $this->id ) ){
48
-            return;
49
-        }
47
+		if( empty( $this->id ) ){
48
+			return;
49
+		}
50 50
 
51
-        $args = array(
52
-            'post_type' => 'lesson',
53
-            'posts_per_page' => 1,
54
-            'post_status' => 'publish',
55
-            'post__in' => array( $this->id ),
56
-        );
51
+		$args = array(
52
+			'post_type' => 'lesson',
53
+			'posts_per_page' => 1,
54
+			'post_status' => 'publish',
55
+			'post__in' => array( $this->id ),
56
+		);
57 57
 
58
-        $this->lesson_page_query  = new WP_Query( $args );
58
+		$this->lesson_page_query  = new WP_Query( $args );
59 59
 
60
-    }
60
+	}
61 61
 
62
-    /**
63
-     * Rendering the shortcode this class is responsible for.
64
-     *
65
-     * @return string $content
66
-     */
67
-    public function render(){
62
+	/**
63
+	 * Rendering the shortcode this class is responsible for.
64
+	 *
65
+	 * @return string $content
66
+	 */
67
+	public function render(){
68 68
 
69
-        if( empty(  $this->id  ) ){
69
+		if( empty(  $this->id  ) ){
70 70
 
71
-            return __( 'Please supply a lesson ID for this shortcode.', 'woothemes-sensei' );
71
+			return __( 'Please supply a lesson ID for this shortcode.', 'woothemes-sensei' );
72 72
 
73
-        }
73
+		}
74 74
 
75
-        //set the wp_query to the current lessons query
76
-        global $wp_query;
77
-        $wp_query = $this->lesson_page_query;
75
+		//set the wp_query to the current lessons query
76
+		global $wp_query;
77
+		$wp_query = $this->lesson_page_query;
78 78
 
79
-        if( have_posts() ){
79
+		if( have_posts() ){
80 80
 
81
-            the_post();
81
+			the_post();
82 82
 
83
-        }else{
83
+		}else{
84 84
 
85
-            return __('No posts found.', 'woothemes-sensei');
85
+			return __('No posts found.', 'woothemes-sensei');
86 86
 
87
-        }
87
+		}
88 88
 
89
-        ob_start();
90
-        Sensei_Templates::get_template('content-single-lesson.php');
91
-        $shortcode_output = ob_get_clean();
89
+		ob_start();
90
+		Sensei_Templates::get_template('content-single-lesson.php');
91
+		$shortcode_output = ob_get_clean();
92 92
 
93
-        // set back the global query
94
-        wp_reset_query();
93
+		// set back the global query
94
+		wp_reset_query();
95 95
 
96
-        return $shortcode_output;
96
+		return $shortcode_output;
97 97
 
98
-    }// end render
98
+	}// end render
99 99
 
100 100
 }// end class
101 101
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) exit; // Exit if accessed directly
3 3
 /**
4 4
  *
5 5
  * Renders the [sensei_lesson_page] shortcode. Display a single lesson based on the ID parameter given.
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      * @param string $content
31 31
      * @param string $shortcode the shortcode that was called for this instance
32 32
      */
33
-    public function __construct( $attributes, $content, $shortcode ){
33
+    public function __construct($attributes, $content, $shortcode) {
34 34
 
35
-        $this->id = isset( $attributes['id'] ) ? $attributes['id'] : '';
35
+        $this->id = isset($attributes['id']) ? $attributes['id'] : '';
36 36
         $this->setup_lesson_query();
37 37
 
38 38
     }
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
      *
43 43
      * @return mixed
44 44
      */
45
-    public function setup_lesson_query(){
45
+    public function setup_lesson_query() {
46 46
 
47
-        if( empty( $this->id ) ){
47
+        if (empty($this->id)) {
48 48
             return;
49 49
         }
50 50
 
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
             'post_type' => 'lesson',
53 53
             'posts_per_page' => 1,
54 54
             'post_status' => 'publish',
55
-            'post__in' => array( $this->id ),
55
+            'post__in' => array($this->id),
56 56
         );
57 57
 
58
-        $this->lesson_page_query  = new WP_Query( $args );
58
+        $this->lesson_page_query = new WP_Query($args);
59 59
 
60 60
     }
61 61
 
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
      *
65 65
      * @return string $content
66 66
      */
67
-    public function render(){
67
+    public function render() {
68 68
 
69
-        if( empty(  $this->id  ) ){
69
+        if (empty($this->id)) {
70 70
 
71
-            return __( 'Please supply a lesson ID for this shortcode.', 'woothemes-sensei' );
71
+            return __('Please supply a lesson ID for this shortcode.', 'woothemes-sensei');
72 72
 
73 73
         }
74 74
 
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
         global $wp_query;
77 77
         $wp_query = $this->lesson_page_query;
78 78
 
79
-        if( have_posts() ){
79
+        if (have_posts()) {
80 80
 
81 81
             the_post();
82 82
 
83
-        }else{
83
+        } else {
84 84
 
85 85
             return __('No posts found.', 'woothemes-sensei');
86 86
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 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 Post Types Class
@@ -146,7 +149,7 @@  discard block
 block discarded – undo
146 149
 
147 150
              return get_page_uri( $settings_course_page->ID );
148 151
 
149
-        }else{
152
+        } else{
150 153
 
151 154
             return 'courses';
152 155
 
Please login to merge, or discard this patch.