@@ -13,46 +13,46 @@ |
||
13 | 13 | */ |
14 | 14 | class Sensei_Student{ |
15 | 15 | |
16 | - /** |
|
17 | - * Get the students full name |
|
18 | - * |
|
19 | - * This function replaces Sensei_Learner_Managment->get_learner_full_name |
|
20 | - * @since 1.9.0 |
|
21 | - * |
|
22 | - * @param $user_id |
|
23 | - * @return bool|mixed|void |
|
24 | - */ |
|
25 | - public static function get_full_name( $user_id ){ |
|
16 | + /** |
|
17 | + * Get the students full name |
|
18 | + * |
|
19 | + * This function replaces Sensei_Learner_Managment->get_learner_full_name |
|
20 | + * @since 1.9.0 |
|
21 | + * |
|
22 | + * @param $user_id |
|
23 | + * @return bool|mixed|void |
|
24 | + */ |
|
25 | + public static function get_full_name( $user_id ){ |
|
26 | 26 | |
27 | - $full_name = ''; |
|
27 | + $full_name = ''; |
|
28 | 28 | |
29 | - if( empty( $user_id ) || ! ( 0 < intval( $user_id ) ) |
|
30 | - || !( get_userdata( $user_id ) ) ){ |
|
31 | - return false; |
|
32 | - } |
|
29 | + if( empty( $user_id ) || ! ( 0 < intval( $user_id ) ) |
|
30 | + || !( get_userdata( $user_id ) ) ){ |
|
31 | + return false; |
|
32 | + } |
|
33 | 33 | |
34 | - // get the user details |
|
35 | - $user = get_user_by( 'id', $user_id ); |
|
34 | + // get the user details |
|
35 | + $user = get_user_by( 'id', $user_id ); |
|
36 | 36 | |
37 | - if( ! empty( $user->first_name ) && ! empty( $user->last_name ) ){ |
|
37 | + if( ! empty( $user->first_name ) && ! empty( $user->last_name ) ){ |
|
38 | 38 | |
39 | - $full_name = trim( $user->first_name ) . ' ' . trim( $user->last_name ); |
|
39 | + $full_name = trim( $user->first_name ) . ' ' . trim( $user->last_name ); |
|
40 | 40 | |
41 | - }else{ |
|
41 | + }else{ |
|
42 | 42 | |
43 | - $full_name = $user->display_name; |
|
43 | + $full_name = $user->display_name; |
|
44 | 44 | |
45 | - } |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Filter the user full name from the get_learner_full_name function. |
|
49 | - * |
|
50 | - * @since 1.8.0 |
|
51 | - * @param $full_name |
|
52 | - * @param $user_id |
|
53 | - */ |
|
54 | - return apply_filters( 'sensei_learner_full_name' , $full_name , $user_id ); |
|
47 | + /** |
|
48 | + * Filter the user full name from the get_learner_full_name function. |
|
49 | + * |
|
50 | + * @since 1.8.0 |
|
51 | + * @param $full_name |
|
52 | + * @param $user_id |
|
53 | + */ |
|
54 | + return apply_filters( 'sensei_learner_full_name' , $full_name , $user_id ); |
|
55 | 55 | |
56 | - }// end get_full_name |
|
56 | + }// end get_full_name |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * |
9 | 9 | * @since 1.9.0 |
10 | 10 | */ |
11 | -class Sensei_Learner{ |
|
11 | +class Sensei_Learner { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Get the students full name |
@@ -19,25 +19,25 @@ discard block |
||
19 | 19 | * @param $user_id |
20 | 20 | * @return bool|mixed|void |
21 | 21 | */ |
22 | - public static function get_full_name( $user_id ){ |
|
22 | + public static function get_full_name($user_id) { |
|
23 | 23 | |
24 | 24 | $full_name = ''; |
25 | 25 | |
26 | - if( empty( $user_id ) || ! ( 0 < intval( $user_id ) ) |
|
27 | - || !( get_userdata( $user_id ) ) ){ |
|
26 | + if (empty($user_id) || ! (0 < intval($user_id)) |
|
27 | + || ! (get_userdata($user_id))) { |
|
28 | 28 | return false; |
29 | 29 | } |
30 | 30 | |
31 | 31 | // get the user details |
32 | - $user = get_user_by( 'id', $user_id ); |
|
32 | + $user = get_user_by('id', $user_id); |
|
33 | 33 | |
34 | - if( ! empty( $user->first_name ) && ! empty( $user->last_name ) ){ |
|
34 | + if ( ! empty($user->first_name) && ! empty($user->last_name)) { |
|
35 | 35 | |
36 | - $full_name = trim( $user->first_name ) . ' ' . trim( $user->last_name ); |
|
36 | + $full_name = trim($user->first_name).' '.trim($user->last_name); |
|
37 | 37 | |
38 | - }else{ |
|
38 | + } else { |
|
39 | 39 | |
40 | - $full_name = $user->display_name; |
|
40 | + $full_name = $user->display_name; |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param $full_name |
49 | 49 | * @param $user_id |
50 | 50 | */ |
51 | - return apply_filters( 'sensei_learner_full_name' , $full_name , $user_id ); |
|
51 | + return apply_filters('sensei_learner_full_name', $full_name, $user_id); |
|
52 | 52 | |
53 | 53 | }// end get_full_name |
54 | 54 |
@@ -166,7 +166,7 @@ |
||
166 | 166 | |
167 | 167 | Sensei_Templates::get_template( 'user/my-courses.php' ); |
168 | 168 | |
169 | - }else{ |
|
169 | + } else{ |
|
170 | 170 | |
171 | 171 | Sensei()->frontend->sensei_login_form(); |
172 | 172 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
7 | 7 | |
8 | 8 | if ( class_exists( 'Teacher_New_Course_Assignment' ) ){ |
9 | - return; |
|
9 | + return; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
@@ -40,40 +40,40 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function __construct() { |
42 | 42 | |
43 | - $this->template = 'teacher-new-course-assignment'; |
|
43 | + $this->template = 'teacher-new-course-assignment'; |
|
44 | 44 | $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have been assigned to a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
45 | 45 | $this->heading = apply_filters( 'sensei_email_heading', __( 'Course assigned to you', 'woothemes-sensei' ), $this->template ); |
46 | - return; |
|
46 | + return; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * trigger function. |
51 | 51 | * |
52 | 52 | * @access public |
53 | - * @param $teacher_id |
|
54 | - * @param $course_id |
|
53 | + * @param $teacher_id |
|
54 | + * @param $course_id |
|
55 | 55 | * @return void |
56 | 56 | */ |
57 | 57 | function trigger( $teacher_id = 0, $course_id = 0 ) { |
58 | 58 | global $sensei_email_data; |
59 | 59 | |
60 | 60 | $this->teacher = new WP_User( $teacher_id ); |
61 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
62 | - $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
61 | + $this->recipient = stripslashes( $this->teacher->user_email ); |
|
62 | + $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
63 | 63 | |
64 | - //course edit link |
|
65 | - $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
64 | + //course edit link |
|
65 | + $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
66 | 66 | |
67 | - // Course name |
|
68 | - $course = get_post( $course_id); |
|
67 | + // Course name |
|
68 | + $course = get_post( $course_id); |
|
69 | 69 | // Construct data array |
70 | 70 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
71 | 71 | 'template' => $this->template, |
72 | 72 | 'heading' => $this->heading, |
73 | 73 | 'teacher_id' => $teacher_id, |
74 | 74 | 'course_id' => $course_id, |
75 | - 'course_name' => $course->post_title, |
|
76 | - 'course_edit_link' => $course_edit_link, |
|
75 | + 'course_name' => $course->post_title, |
|
76 | + 'course_edit_link' => $course_edit_link, |
|
77 | 77 | ), $this->template ); |
78 | 78 | |
79 | 79 | // Send mail |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | * This email will be sent to a teacher when a course is assigned to them. |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
6 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
7 | 7 | |
8 | -if ( class_exists('Sensei_Email_Teacher_New_Course_Assignment') ){ |
|
8 | +if (class_exists('Sensei_Email_Teacher_New_Course_Assignment')) { |
|
9 | 9 | return; |
10 | 10 | } |
11 | 11 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | function __construct() { |
37 | 37 | |
38 | 38 | $this->template = 'teacher-new-course-assignment'; |
39 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have been assigned to a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
40 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Course assigned to you', 'woothemes-sensei' ), $this->template ); |
|
39 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] You have been assigned to a course', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
40 | + $this->heading = apply_filters('sensei_email_heading', __('Course assigned to you', 'woothemes-sensei'), $this->template); |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 | |
@@ -49,30 +49,30 @@ discard block |
||
49 | 49 | * @param $course_id |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - function trigger( $teacher_id = 0, $course_id = 0 ) { |
|
52 | + function trigger($teacher_id = 0, $course_id = 0) { |
|
53 | 53 | global $sensei_email_data; |
54 | 54 | |
55 | - $this->teacher = new WP_User( $teacher_id ); |
|
56 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
57 | - $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
55 | + $this->teacher = new WP_User($teacher_id); |
|
56 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
57 | + $this->subject = __('New course assigned to you', 'woothemes-sensei'); |
|
58 | 58 | |
59 | 59 | //course edit link |
60 | - $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
60 | + $course_edit_link = admin_url('post.php?post='.$course_id.'&action=edit'); |
|
61 | 61 | |
62 | 62 | // Course name |
63 | - $course = get_post( $course_id); |
|
63 | + $course = get_post($course_id); |
|
64 | 64 | // Construct data array |
65 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
65 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
66 | 66 | 'template' => $this->template, |
67 | 67 | 'heading' => $this->heading, |
68 | 68 | 'teacher_id' => $teacher_id, |
69 | 69 | 'course_id' => $course_id, |
70 | 70 | 'course_name' => $course->post_title, |
71 | 71 | 'course_edit_link' => $course_edit_link, |
72 | - ), $this->template ); |
|
72 | + ), $this->template); |
|
73 | 73 | |
74 | 74 | // Send mail |
75 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
75 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Class Sensei_Storefront |
|
4 | - * |
|
5 | - * Responsible for wrapping Storefront theme Sensei content |
|
6 | - * with the correct markup |
|
7 | - * |
|
8 | - * @package Views |
|
9 | - * @subpackage Theme-Integration |
|
10 | - * @author Automattic |
|
11 | - * |
|
12 | - * @since 1.9.0 |
|
3 | + * Class Sensei_Storefront |
|
4 | + * |
|
5 | + * Responsible for wrapping Storefront theme Sensei content |
|
6 | + * with the correct markup |
|
7 | + * |
|
8 | + * @package Views |
|
9 | + * @subpackage Theme-Integration |
|
10 | + * @author Automattic |
|
11 | + * |
|
12 | + * @since 1.9.0 |
|
13 | 13 | */ |
14 | 14 | Class Sensei_Storefront extends Sensei__S { } |