Completed
Push — master ( 6f9e7a...de5671 )
by Dwain
09:23
created
templates/single-quiz/question_type-boolean.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 
13 13
 <?php
14 14
 
15
-    /**
16
-     * Get the question data with the current quiz id
17
-     * All data is loaded in this array to keep the template clean.
18
-     */
19
-    $question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
20
-    $boolean_options = array( 'true', 'false' );
15
+	/**
16
+	 * Get the question data with the current quiz id
17
+	 * All data is loaded in this array to keep the template clean.
18
+	 */
19
+	$question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
20
+	$boolean_options = array( 'true', 'false' );
21 21
 
22 22
 ?>
23 23
 
@@ -25,42 +25,42 @@  discard block
 block discarded – undo
25 25
 
26 26
     <?php
27 27
 
28
-    // setup the options the right answer set by the admin/teacher
29
-    // will be compared to.
30
-    $boolean_options = array( 'true', 'false' );
28
+	// setup the options the right answer set by the admin/teacher
29
+	// will be compared to.
30
+	$boolean_options = array( 'true', 'false' );
31 31
 
32
-    //loop through the 2 boolean options and compare them with
33
-    // the selected right answer
34
-    foreach ( $boolean_options as $option ){
32
+	//loop through the 2 boolean options and compare them with
33
+	// the selected right answer
34
+	foreach ( $boolean_options as $option ){
35 35
 
36
-        $answer_class = '';
36
+		$answer_class = '';
37 37
 
38
-        // Add classes to indicate correctness, only if there is a grade
39
-        if( isset( $question_data[ 'user_correct' ] ) && 0 < $question_data['question_grade'] ) {
38
+		// Add classes to indicate correctness, only if there is a grade
39
+		if( isset( $question_data[ 'user_correct' ] ) && 0 < $question_data['question_grade'] ) {
40 40
 
41
-            if( $question_right_answer == $question_data[ 'question_right_answer' ] ) {
41
+			if( $question_right_answer == $question_data[ 'question_right_answer' ] ) {
42 42
 
43
-                if( $question_data[ 'user_correct' ] ) {
43
+				if( $question_data[ 'user_correct' ] ) {
44 44
 
45
-                    $answer_class = 'user_right';
45
+					$answer_class = 'user_right';
46 46
 
47
-                }
47
+				}
48 48
 
49
-                $answer_class .= ' right_answer';
49
+				$answer_class .= ' right_answer';
50 50
 
51
-            } else {
51
+			} else {
52 52
 
53
-                if( ! $question_data[ 'user_correct' ] ) {
53
+				if( ! $question_data[ 'user_correct' ] ) {
54 54
 
55
-                    $answer_class = 'user_wrong';
55
+					$answer_class = 'user_wrong';
56 56
 
57
-                }
57
+				}
58 58
 
59
-            } // end if right answer == current booloean options
59
+			} // end if right answer == current booloean options
60 60
 
61
-        }// end if $user_correct .. $question_grade
61
+		}// end if $user_correct .. $question_grade
62 62
 
63
-    ?>
63
+	?>
64 64
 
65 65
     <li class="<?php esc_attr_e( $answer_class ); ?>">
66 66
 
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
         <label for="<?php echo esc_attr( 'question_' . $question_data[ 'ID' ]  ) . '-option-'.$option; ?>">
75 75
             <?php
76 76
 
77
-            if( 'true' == $option ){
77
+			if( 'true' == $option ){
78 78
 
79
-                _e( 'True', 'woothemes-sensei' );
79
+				_e( 'True', 'woothemes-sensei' );
80 80
 
81
-            }else{
81
+			}else{
82 82
 
83
-                _e( 'False', 'woothemes-sensei' );
83
+				_e( 'False', 'woothemes-sensei' );
84 84
 
85
-            }
85
+			}
86 86
 
87
-            ?>
87
+			?>
88 88
 
89 89
 
90 90
         </label>
Please login to merge, or discard this patch.
templates/single-quiz/question_type-file-upload.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
 <?php
16 16
 
17
-    /**
18
-     * Get the question data with the current quiz id
19
-     * All data is loaded in this array to keep the template clean.
20
-     */
21
-    $question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
17
+	/**
18
+	 * Get the question data with the current quiz id
19
+	 * All data is loaded in this array to keep the template clean.
20
+	 */
21
+	$question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
22 22
 
23 23
 ?>
24 24
 
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 
35 35
         <?php
36 36
 
37
-        printf( __( 'Submitted file: %1$s', 'woothemes-sensei' ), '<a href="' . esc_url(  $question_data[ 'answer_media_url' ] )
38
-            . '" target="_blank">'
39
-            . esc_html(  $question_data[ 'answer_media_filename' ] ) . '</a>' );
37
+		printf( __( 'Submitted file: %1$s', 'woothemes-sensei' ), '<a href="' . esc_url(  $question_data[ 'answer_media_url' ] )
38
+			. '" target="_blank">'
39
+			. esc_html(  $question_data[ 'answer_media_filename' ] ) . '</a>' );
40 40
 
41
-        ?>
41
+		?>
42 42
 
43 43
     </p>
44 44
     <?php if( !  $question_data[ 'lesson_complete' ]  ) { ?>
Please login to merge, or discard this patch.
templates/learner-profile.php 1 patch
Indentation   +42 added lines, -42 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 course archives, including the course page template.
4
- *
5
- * Override this template by copying it to yourtheme/sensei/archive-course.php
6
- *
7
- * @author 		Automattic
8
- * @package 	Sensei
9
- * @category    Templates
10
- * @version     1.9.0
11
- */
3
+	 * The Template for displaying course archives, including the course page template.
4
+	 *
5
+	 * Override this template by copying it to yourtheme/sensei/archive-course.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 hook fire inside learner-profile.php before the content
19
- *
20
- * @since 1.9.0
21
- *
22
- * @hooked Sensei_Learner_Profiles::deprecate_sensei_learner_profile_content_hook   - 10
23
- * @hooked Sensei_Templates::fire_sensei_complete_course_hook                      - 20
24
- */
18
+	 * This hook fire inside learner-profile.php before the content
19
+	 *
20
+	 * @since 1.9.0
21
+	 *
22
+	 * @hooked Sensei_Learner_Profiles::deprecate_sensei_learner_profile_content_hook   - 10
23
+	 * @hooked Sensei_Templates::fire_sensei_complete_course_hook                      - 20
24
+	 */
25 25
 do_action( 'sensei_learner_profile_content_before' );
26 26
 ?>
27 27
 
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
     <section id="learner-info" class="learner-info entry fix">
31 31
 
32 32
         <?php
33
-        /**
34
-         * This hook fire inside learner-profile.php inside directly before the content
35
-         *
36
-         * @since 1.9.0
37
-         *
38
-         * @hooked  Sensei_Templates::fire_frontend_messages_hook
39
-         */
40
-        do_action( 'sensei_learner_profile_inside_content_before' );
41
-        ?>
33
+		/**
34
+		 * This hook fire inside learner-profile.php inside directly before the content
35
+		 *
36
+		 * @since 1.9.0
37
+		 *
38
+		 * @hooked  Sensei_Templates::fire_frontend_messages_hook
39
+		 */
40
+		do_action( 'sensei_learner_profile_inside_content_before' );
41
+		?>
42 42
 
43 43
         <?php  $learner_user = get_user_by( 'slug', get_query_var('learner_profile') );  // get requested learner object ?>
44 44
 
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
 
47 47
             <?php
48 48
 
49
-            // show the user information
50
-            Sensei_Learner_Profiles::user_info( $learner_user );
49
+			// show the user information
50
+			Sensei_Learner_Profiles::user_info( $learner_user );
51 51
 
52
-            ?>
52
+			?>
53 53
 
54 54
             <?php
55 55
 
56
-            // show the user courses
57
-            Sensei()->course->load_user_courses_content( $learner_user );
56
+			// show the user courses
57
+			Sensei()->course->load_user_courses_content( $learner_user );
58 58
 
59
-            ?>
59
+			?>
60 60
 
61 61
         <?php }else{  ?>
62 62
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
         <?php } ?>
70 70
 
71 71
         <?php
72
-        /**
73
-         * This hook fire inside learner-profile.php inside directly after the content
74
-         *
75
-         * @since 1.9.0
76
-         */
77
-        do_action( 'sensei_learner_profile_inside_content_after' );
78
-        ?>
72
+		/**
73
+		 * This hook fire inside learner-profile.php inside directly after the content
74
+		 *
75
+		 * @since 1.9.0
76
+		 */
77
+		do_action( 'sensei_learner_profile_inside_content_after' );
78
+		?>
79 79
 
80 80
     </section>
81 81
 
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 
84 84
 <?php
85 85
 /**
86
- * This hook fire inside learner-profile.php after the content
87
- *
88
- * @since 1.9.0
89
- */
86
+		 * This hook fire inside learner-profile.php after the content
87
+		 *
88
+		 * @since 1.9.0
89
+		 */
90 90
 do_action( 'sensei_learner_profile_content_after' );
91 91
 ?>
92 92
 
Please login to merge, or discard this patch.
templates/loop-message.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,67 +1,67 @@
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) exit;
3 3
 /**
4
- * The Template for outputting Message Archive items
5
- *
6
- * Override this template by copying it to yourtheme/sensei/loop-message.php
7
- *
8
- * @author 		Automattic
9
- * @package 	Sensei
10
- * @category    Templates
11
- * @version     1.9.0
12
- */
4
+		 * The Template for outputting Message Archive items
5
+		 *
6
+		 * Override this template by copying it to yourtheme/sensei/loop-message.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
- * This runs before the the message loop items in the loop-message.php template. It runs
18
- * only only for the message 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 message loop items in the loop-message.php template. It runs
18
+		 * only only for the message 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_message_before' );
24 24
 ?>
25 25
 
26 26
 <div class="message-container" >
27 27
 
28 28
     <?php
29
-    /**
30
-     * This runs before the post type items in the loop.php template. It
31
-     * runs within the message loop <ul> tag.
32
-     *
33
-     * @since 1.9.0
34
-     */
35
-    do_action( 'sensei_loop_message_inside_before' );
36
-    ?>
29
+	/**
30
+	 * This runs before the post type items in the loop.php template. It
31
+	 * runs within the message loop <ul> tag.
32
+	 *
33
+	 * @since 1.9.0
34
+	 */
35
+	do_action( 'sensei_loop_message_inside_before' );
36
+	?>
37 37
 
38 38
     <?php
39
-    // loop through all messages
40
-    while ( have_posts() ) { the_post();
39
+	// loop through all messages
40
+	while ( have_posts() ) { the_post();
41 41
 
42
-        sensei_load_template_part('content','message');
42
+		sensei_load_template_part('content','message');
43 43
 
44
-    }
45
-    ?>
44
+	}
45
+	?>
46 46
 
47 47
     <?php
48
-    /**
49
-     * This runs after the post type items in the loop.php template. It runs
50
-     * only for the specified post type
51
-     *
52
-     * @since 1.9.0
53
-     */
54
-    do_action( 'sensei_loop_message_inside_after' );
55
-    ?>
48
+	/**
49
+	 * This runs after the post type items in the loop.php template. It runs
50
+	 * only for the specified post type
51
+	 *
52
+	 * @since 1.9.0
53
+	 */
54
+	do_action( 'sensei_loop_message_inside_after' );
55
+	?>
56 56
 
57 57
 </div>
58 58
 
59 59
 <?php
60 60
 /**
61
- * This runs after the post type items in the loop.php template. It runs
62
- * only for the specified post type
63
- *
64
- * @since 1.9.0
65
- */
61
+	 * This runs after the post type items in the loop.php template. It runs
62
+	 * only for the specified post type
63
+	 *
64
+	 * @since 1.9.0
65
+	 */
66 66
 do_action( 'sensei_loop_message_after' );
67 67
 ?>
Please login to merge, or discard this patch.
templates/archive-message.php 1 patch
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.
templates/loop-course.php 1 patch
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.
templates/user/login-form.php 1 patch
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.
templates/user/my-courses.php 1 patch
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.
includes/shortcodes/class-sensei-shortcode-courses.php 1 patch
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.