Completed
Push — master ( b09b8b...45e17f )
by Dwain
07:46
created
includes/class-sensei-autoloader.php 1 patch
Spacing   +21 added lines, -21 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; // security check, don't load file outside WP
2
+if ( ! defined('ABSPATH')) exit; // security check, don't load file outside WP
3 3
 /**
4 4
  * Sensei Autoloader Class
5 5
  *
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
      * Constructor
28 28
      * @since 1.9.0
29 29
      */
30
-    public function __construct(){
30
+    public function __construct() {
31 31
 
32 32
         // make sure we do not override an existing autoload function
33
-        if( function_exists('__autoload') ){
34
-           spl_autoload_register( '__autoload' );
33
+        if (function_exists('__autoload')) {
34
+           spl_autoload_register('__autoload');
35 35
         }
36 36
 
37 37
         // setup a relative path for the current autoload instance
38
-        $this->include_path = trailingslashit( untrailingslashit( dirname( __FILE__ ) ) );
38
+        $this->include_path = trailingslashit(untrailingslashit(dirname(__FILE__)));
39 39
 
40 40
         //setup the class file map
41 41
         $this->initialize_class_file_map();
42 42
 
43 43
         // add Sensei custom auto loader
44
-        spl_autoload_register( array( $this, 'autoload' )  );
44
+        spl_autoload_register(array($this, 'autoload'));
45 45
 
46 46
     }
47 47
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @since 1.9.0
53 53
      */
54
-    public function initialize_class_file_map(){
54
+    public function initialize_class_file_map() {
55 55
 
56 56
         $this->class_file_map = array(
57 57
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
             /**
64 64
              * Admin
65 65
              */
66
-            'Sensei_Welcome'            => 'admin/class-sensei-welcome.php' ,
67
-            'Sensei_Learner_Management' => 'admin/class-sensei-learner-management.php' ,
66
+            'Sensei_Welcome'            => 'admin/class-sensei-welcome.php',
67
+            'Sensei_Learner_Management' => 'admin/class-sensei-learner-management.php',
68 68
 
69 69
             /**
70 70
              * Shortcodes
@@ -93,38 +93,38 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      * Autoload all sensei files as the class names are used.
95 95
      */
96
-    public function autoload( $class ){
96
+    public function autoload($class) {
97 97
 
98 98
         // only handle classes with the word `sensei` in it
99
-        if( ! is_numeric( strpos ( strtolower( $class ), 'sensei') ) ){
99
+        if ( ! is_numeric(strpos(strtolower($class), 'sensei'))) {
100 100
 
101 101
             return;
102 102
 
103 103
         }
104 104
 
105 105
         // exit if we didn't provide mapping for this class
106
-        if( isset( $this->class_file_map[ $class ] ) ){
106
+        if (isset($this->class_file_map[$class])) {
107 107
 
108
-            $file_location = $this->include_path . $this->class_file_map[ $class ];
109
-            require_once( $file_location);
108
+            $file_location = $this->include_path.$this->class_file_map[$class];
109
+            require_once($file_location);
110 110
             return;
111 111
 
112 112
         }
113 113
 
114 114
         // check for file in the main includes directory
115
-        $class_file_path = $this->include_path . 'class-'.str_replace( '_','-', strtolower( $class ) ) . '.php';
116
-        if( file_exists( $class_file_path ) ){
115
+        $class_file_path = $this->include_path.'class-'.str_replace('_', '-', strtolower($class)).'.php';
116
+        if (file_exists($class_file_path)) {
117 117
 
118
-            require_once( $class_file_path );
118
+            require_once($class_file_path);
119 119
             return;
120 120
         }
121 121
 
122 122
         // lastly check legacy types
123
-        $stripped_woothemes_from_class = str_replace( 'woothemes_','', strtolower( $class ) ); // remove woothemes
124
-        $legacy_class_file_path = $this->include_path . 'class-'.str_replace( '_','-', strtolower( $stripped_woothemes_from_class ) ) . '.php';
125
-        if( file_exists( $legacy_class_file_path ) ){
123
+        $stripped_woothemes_from_class = str_replace('woothemes_', '', strtolower($class)); // remove woothemes
124
+        $legacy_class_file_path = $this->include_path.'class-'.str_replace('_', '-', strtolower($stripped_woothemes_from_class)).'.php';
125
+        if (file_exists($legacy_class_file_path)) {
126 126
 
127
-            require_once( $legacy_class_file_path );
127
+            require_once($legacy_class_file_path);
128 128
             return;
129 129
         }
130 130
 
Please login to merge, or discard this patch.
includes/class-sensei-posttypes.php 1 patch
Spacing   +237 added lines, -237 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 Post Types Class
@@ -41,43 +41,43 @@  discard block
 block discarded – undo
41 41
 	 * Constructor
42 42
 	 * @since  1.0.0
43 43
 	 */
44
-	public function __construct () {
44
+	public function __construct() {
45 45
 
46 46
 		// Setup Post Types
47 47
 		$this->labels = array();
48 48
         $this->token = 'woothemes-sensei-posttypes';
49 49
 
50 50
 		$this->setup_post_type_labels_base();
51
-		add_action( 'init', array( $this, 'setup_course_post_type' ), 100 );
52
-		add_action( 'init', array( $this, 'setup_lesson_post_type' ), 100 );
53
-		add_action( 'init', array( $this, 'setup_quiz_post_type' ), 100 );
54
-		add_action( 'init', array( $this, 'setup_question_post_type' ), 100 );
55
-		add_action( 'init', array( $this, 'setup_multiple_question_post_type' ), 100 );
56
-		add_action( 'init', array( $this, 'setup_sensei_message_post_type' ), 100 );
51
+		add_action('init', array($this, 'setup_course_post_type'), 100);
52
+		add_action('init', array($this, 'setup_lesson_post_type'), 100);
53
+		add_action('init', array($this, 'setup_quiz_post_type'), 100);
54
+		add_action('init', array($this, 'setup_question_post_type'), 100);
55
+		add_action('init', array($this, 'setup_multiple_question_post_type'), 100);
56
+		add_action('init', array($this, 'setup_sensei_message_post_type'), 100);
57 57
 
58 58
 		// Setup Taxonomies
59
-		add_action( 'init', array( $this, 'setup_course_category_taxonomy' ), 100 );
60
-		add_action( 'init', array( $this, 'setup_quiz_type_taxonomy' ), 100 );
61
-		add_action( 'init', array( $this, 'setup_question_type_taxonomy' ), 100 );
62
-		add_action( 'init', array( $this, 'setup_question_category_taxonomy' ), 100 );
63
-		add_action( 'init', array( $this, 'setup_lesson_tag_taxonomy' ), 100 );
59
+		add_action('init', array($this, 'setup_course_category_taxonomy'), 100);
60
+		add_action('init', array($this, 'setup_quiz_type_taxonomy'), 100);
61
+		add_action('init', array($this, 'setup_question_type_taxonomy'), 100);
62
+		add_action('init', array($this, 'setup_question_category_taxonomy'), 100);
63
+		add_action('init', array($this, 'setup_lesson_tag_taxonomy'), 100);
64 64
 
65 65
 		// Load Post Type Objects
66
-		$default_post_types = array( 'course' => 'Course', 'lesson' => 'Lesson', 'quiz' => 'Quiz', 'question' => 'Question', 'messages' => 'Messages' ) ;
67
-		$this->load_posttype_objects( $default_post_types );
66
+		$default_post_types = array('course' => 'Course', 'lesson' => 'Lesson', 'quiz' => 'Quiz', 'question' => 'Question', 'messages' => 'Messages');
67
+		$this->load_posttype_objects($default_post_types);
68 68
 
69 69
 		// Admin functions
70
-		if ( is_admin() ) {
71
-			$this->set_role_cap_defaults( $default_post_types );
70
+		if (is_admin()) {
71
+			$this->set_role_cap_defaults($default_post_types);
72 72
 			global $pagenow;
73
-			if ( ( $pagenow == 'post.php' || $pagenow == 'post-new.php' ) ) {
74
-				add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 10 );
75
-				add_filter( 'post_updated_messages', array( $this, 'setup_post_type_messages' ) );
73
+			if (($pagenow == 'post.php' || $pagenow == 'post-new.php')) {
74
+				add_filter('enter_title_here', array($this, 'enter_title_here'), 10);
75
+				add_filter('post_updated_messages', array($this, 'setup_post_type_messages'));
76 76
 			} // End If Statement
77 77
 		} // End If Statement
78 78
 
79 79
 		// Add 'Edit Quiz' link to admin bar
80
-		add_action( 'admin_bar_menu', array( $this, 'quiz_admin_bar_menu' ), 81 );
80
+		add_action('admin_bar_menu', array($this, 'quiz_admin_bar_menu'), 81);
81 81
 
82 82
 	} // End __construct()
83 83
 
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 	 * @param array $posttypes (default: array())
89 89
 	 * @return void
90 90
 	 */
91
-	public function load_posttype_objects( $posttypes = array() ) {
91
+	public function load_posttype_objects($posttypes = array()) {
92 92
 
93
-		foreach ( $posttypes as $posttype_token => $posttype_name ) {
93
+		foreach ($posttypes as $posttype_token => $posttype_name) {
94 94
 
95 95
 			// Load the files
96
-			$class_name = 'WooThemes_Sensei_' . $posttype_name;
96
+			$class_name = 'WooThemes_Sensei_'.$posttype_name;
97 97
 			$this->$posttype_token = new $class_name();
98 98
 			$this->$posttype_token->token = $posttype_token;
99 99
 
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
      * @uses  Sensei()
108 108
 	 * @return void
109 109
 	 */
110
-	public function setup_course_post_type () {
110
+	public function setup_course_post_type() {
111 111
 
112 112
 		$args = array(
113
-		    'labels'              => $this->create_post_type_labels( $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ),
113
+		    'labels'              => $this->create_post_type_labels($this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu']),
114 114
 		    'public'              => true,
115 115
 		    'publicly_queryable'  => true,
116 116
 		    'show_ui'             => true,
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		    'show_in_admin_bar'   => true,
119 119
 		    'query_var'           => true,
120 120
 		    'rewrite'             => array(
121
-                'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) ,
121
+                'slug' => esc_attr(apply_filters('sensei_course_slug', _x('course', 'post type single url base', 'woothemes-sensei'))),
122 122
                 'with_front' => true,
123 123
                 'feeds' => true,
124 124
                 'pages' => true
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             'has_archive'         => $this->get_course_post_type_archive_slug(),
129 129
 		    'hierarchical'        => false,
130 130
 		    'menu_position'       => 51,
131
-		    'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail' )
131
+		    'supports'            => array('title', 'editor', 'excerpt', 'thumbnail')
132 132
 		);
133 133
 
134 134
         /**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
          * @since 1.9.0
138 138
          * @param array $args
139 139
          */
140
-		register_post_type( 'course', apply_filters( 'sensei_register_post_type_course', $args ) );
140
+		register_post_type('course', apply_filters('sensei_register_post_type_course', $args));
141 141
 
142 142
 	} // End setup_course_post_type()
143 143
 
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
      *
157 157
      * @return false|string
158 158
      */
159
-    public function get_course_post_type_archive_slug(){
159
+    public function get_course_post_type_archive_slug() {
160 160
 
161
-        $settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) );
161
+        $settings_course_page = get_post(Sensei()->settings->get('course_page'));
162 162
 
163 163
         // for a valid post that doesn't have any of the old short codes set the archive the same
164 164
         // as the page URI
165
-        if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){
165
+        if (is_a($settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes($settings_course_page->post_content)) {
166 166
 
167
-             return get_page_uri( $settings_course_page->ID );
167
+             return get_page_uri($settings_course_page->ID);
168 168
 
169
-        }else{
169
+        } else {
170 170
 
171 171
             return 'courses';
172 172
 
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
      *
185 185
      * @return bool
186 186
      */
187
-    public function has_old_shortcodes( $content ){
187
+    public function has_old_shortcodes($content) {
188 188
 
189
-        return  ( has_shortcode( $content, 'newcourses')
190
-        || has_shortcode( $content, 'featuredcourses')
191
-        || has_shortcode( $content, 'freecourses')
192
-        || has_shortcode( $content, 'paidcourses') );
189
+        return  (has_shortcode($content, 'newcourses')
190
+        || has_shortcode($content, 'featuredcourses')
191
+        || has_shortcode($content, 'freecourses')
192
+        || has_shortcode($content, 'paidcourses'));
193 193
 
194 194
     }// end has old shortcodes
195 195
 
@@ -200,27 +200,27 @@  discard block
 block discarded – undo
200 200
 	 * @uses  Sensei()
201 201
 	 * @return void
202 202
 	 */
203
-	public function setup_lesson_post_type () {
203
+	public function setup_lesson_post_type() {
204 204
 
205 205
 
206
-		$supports_array = array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' );
206
+		$supports_array = array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes');
207 207
 		$allow_comments = false;
208
-		if ( isset( Sensei()->settings->settings[ 'lesson_comments' ] ) ) {
209
-			$allow_comments = Sensei()->settings->settings[ 'lesson_comments' ];
208
+		if (isset(Sensei()->settings->settings['lesson_comments'])) {
209
+			$allow_comments = Sensei()->settings->settings['lesson_comments'];
210 210
 		} // End If Statement
211
-		if ( $allow_comments ) {
212
-			array_push( $supports_array, 'comments' );
211
+		if ($allow_comments) {
212
+			array_push($supports_array, 'comments');
213 213
 		} // End If Statement
214 214
 
215 215
 		$args = array(
216
-		    'labels' => $this->create_post_type_labels(  $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ),
216
+		    'labels' => $this->create_post_type_labels($this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu']),
217 217
 		    'public' => true,
218 218
 		    'publicly_queryable' => true,
219 219
 		    'show_ui' => true,
220 220
 		    'show_in_menu' => true,
221 221
 		    'query_var' => true,
222 222
 		    'rewrite' => array(
223
-                'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) ,
223
+                'slug' => esc_attr(apply_filters('sensei_lesson_slug', _x('lesson', 'post type single slug', 'woothemes-sensei'))),
224 224
                 'with_front' =>  true,
225 225
                 'feeds' => true,
226 226
                 'pages' => true
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
          * @since 1.9.0
240 240
          * @param array $args
241 241
          */
242
-		register_post_type( 'lesson', apply_filters( 'sensei_register_post_type_lesson', $args ) );
242
+		register_post_type('lesson', apply_filters('sensei_register_post_type_lesson', $args));
243 243
 
244 244
 	} // End setup_lesson_post_type()
245 245
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @uses  Sensei()
250 250
 	 * @return void
251 251
 	 */
252
-	public function setup_quiz_post_type () {
252
+	public function setup_quiz_post_type() {
253 253
 
254 254
 
255 255
 		$args = array(
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		    'query_var' => true,
267 267
 		    'exclude_from_search' => true,
268 268
 		    'rewrite' => array(
269
-                'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) ,
269
+                'slug' => esc_attr(apply_filters('sensei_quiz_slug', _x('quiz', 'post type single slug', 'woothemes-sensei'))),
270 270
                 'with_front' =>  true,
271 271
                 'feeds' => true,
272 272
                 'pages' => true
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 		    'has_archive' => false,
277 277
 		    'hierarchical' => false,
278 278
 		    'menu_position' => 20, // Below "Pages"
279
-		    'supports' => array( '' )
279
+		    'supports' => array('')
280 280
 		);
281 281
 
282 282
         /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
          * @since 1.9.0
286 286
          * @param array $args
287 287
          */
288
-		register_post_type( 'quiz', apply_filters( 'sensei_register_post_type_quiz', $args ) );
288
+		register_post_type('quiz', apply_filters('sensei_register_post_type_quiz', $args));
289 289
 
290 290
 	} // End setup_quiz_post_type()
291 291
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
 	 * @since  1.0.0
296 296
 	 * @return void
297 297
 	 */
298
-	public function setup_question_post_type () {
298
+	public function setup_question_post_type() {
299 299
 
300 300
 		$args = array(
301
-		    'labels' => $this->create_post_type_labels( $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ),
301
+		    'labels' => $this->create_post_type_labels($this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu']),
302 302
 		    'public' => false,
303 303
 		    'publicly_queryable' => true,
304 304
 		    'show_ui' => true,
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 		    'query_var' => true,
308 308
 		    'exclude_from_search' => true,
309 309
 		    'rewrite' => array(
310
-                'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
310
+                'slug' => esc_attr(apply_filters('sensei_question_slug', _x('question', 'post type single slug', 'woothemes-sensei'))),
311 311
                 'with_front' =>  true,
312 312
                 'feeds' => true,
313 313
                 'pages' => true
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		    'has_archive' => true,
318 318
 		    'hierarchical' => false,
319 319
 		    'menu_position' => 51,
320
-		    'supports' => array( 'title' )
320
+		    'supports' => array('title')
321 321
 		);
322 322
 
323 323
         /**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
          * @since 1.9.0
327 327
          * @param array $args
328 328
          */
329
-		register_post_type( 'question', apply_filters('sensei_register_post_type_question', $args ) );
329
+		register_post_type('question', apply_filters('sensei_register_post_type_question', $args));
330 330
 
331 331
 	} // End setup_question_post_type()
332 332
 
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
 	 * @since  1.6.0
336 336
 	 * @return void
337 337
 	 */
338
-	public function setup_multiple_question_post_type () {
338
+	public function setup_multiple_question_post_type() {
339 339
 
340 340
 		$args = array(
341
-		    'labels' => $this->create_post_type_labels( $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ),
341
+		    'labels' => $this->create_post_type_labels($this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu']),
342 342
 		    'public' => false,
343 343
 		    'publicly_queryable' => false,
344 344
 		    'show_ui' => false,
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		    'query_var' => false,
348 348
 		    'exclude_from_search' => true,
349 349
 		    'rewrite' => array(
350
-                'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
350
+                'slug' => esc_attr(apply_filters('sensei_multiple_question_slug', _x('multiple_question', 'post type single slug', 'woothemes-sensei'))),
351 351
                 'with_front' =>  false,
352 352
                 'feeds' => false,
353 353
                 'pages' => false
@@ -357,10 +357,10 @@  discard block
 block discarded – undo
357 357
 		    'has_archive' => false,
358 358
 		    'hierarchical' => false,
359 359
 		    'menu_position' => 51,
360
-		    'supports' => array( 'title', 'custom-fields' )
360
+		    'supports' => array('title', 'custom-fields')
361 361
 		);
362 362
 
363
-		register_post_type( 'multiple_question', $args );
363
+		register_post_type('multiple_question', $args);
364 364
 	} // End setup_multiple_question_post_type()
365 365
 
366 366
 	/**
@@ -368,13 +368,13 @@  discard block
 block discarded – undo
368 368
 	 * @since  1.6.0
369 369
 	 * @return void
370 370
 	 */
371
-	public function setup_sensei_message_post_type () {
371
+	public function setup_sensei_message_post_type() {
372 372
 
373 373
 
374
-		if( ! isset( Sensei()->settings->settings['messages_disable'] ) || ! Sensei()->settings->settings['messages_disable'] ) {
374
+		if ( ! isset(Sensei()->settings->settings['messages_disable']) || ! Sensei()->settings->settings['messages_disable']) {
375 375
 
376 376
 			$args = array(
377
-			    'labels' => $this->create_post_type_labels( $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ),
377
+			    'labels' => $this->create_post_type_labels($this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu']),
378 378
 			    'public' => true,
379 379
 			    'publicly_queryable' => true,
380 380
 			    'show_ui' => true,
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			    'query_var' => true,
384 384
 			    'exclude_from_search' => true,
385 385
 			    'rewrite' => array(
386
-                    'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) ,
386
+                    'slug' => esc_attr(apply_filters('sensei_messages_slug', _x('messages', 'post type single slug', 'woothemes-sensei'))),
387 387
                     'with_front' =>  false,
388 388
                     'feeds' => false,
389 389
                     'pages' => true
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			    'has_archive' => true,
394 394
 			    'hierarchical' => false,
395 395
 			    'menu_position' => 50,
396
-			    'supports' => array( 'title', 'editor', 'comments' ),
396
+			    'supports' => array('title', 'editor', 'comments'),
397 397
 			);
398 398
 
399 399
             /**
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
              * @since 1.9.0
403 403
              * @param array $args
404 404
              */
405
-			register_post_type( 'sensei_message', apply_filters('sensei_register_post_type_sensei_message',  $args ) );
405
+			register_post_type('sensei_message', apply_filters('sensei_register_post_type_sensei_message', $args));
406 406
 		}
407 407
 	} // End setup_sensei_message_post_type()
408 408
 
@@ -411,20 +411,20 @@  discard block
 block discarded – undo
411 411
 	 * @since  1.1.0
412 412
 	 * @return void
413 413
 	 */
414
-	public function setup_course_category_taxonomy () {
414
+	public function setup_course_category_taxonomy() {
415 415
 		// "Course Categories" Custom Taxonomy
416 416
 		$labels = array(
417
-			'name' => _x( 'Course Categories', 'taxonomy general name', 'woothemes-sensei' ),
418
-			'singular_name' => _x( 'Course Category', 'taxonomy singular name', 'woothemes-sensei' ),
419
-			'search_items' =>  __( 'Search Course Categories', 'woothemes-sensei' ),
420
-			'all_items' => __( 'All Course Categories', 'woothemes-sensei' ),
421
-			'parent_item' => __( 'Parent Course Category', 'woothemes-sensei' ),
422
-			'parent_item_colon' => __( 'Parent Course Category:', 'woothemes-sensei' ),
423
-			'edit_item' => __( 'Edit Course Category', 'woothemes-sensei' ),
424
-			'update_item' => __( 'Update Course Category', 'woothemes-sensei' ),
425
-			'add_new_item' => __( 'Add New Course Category', 'woothemes-sensei' ),
426
-			'new_item_name' => __( 'New Course Category Name', 'woothemes-sensei' ),
427
-			'menu_name' => __( 'Course Categories', 'woothemes-sensei' ),
417
+			'name' => _x('Course Categories', 'taxonomy general name', 'woothemes-sensei'),
418
+			'singular_name' => _x('Course Category', 'taxonomy singular name', 'woothemes-sensei'),
419
+			'search_items' =>  __('Search Course Categories', 'woothemes-sensei'),
420
+			'all_items' => __('All Course Categories', 'woothemes-sensei'),
421
+			'parent_item' => __('Parent Course Category', 'woothemes-sensei'),
422
+			'parent_item_colon' => __('Parent Course Category:', 'woothemes-sensei'),
423
+			'edit_item' => __('Edit Course Category', 'woothemes-sensei'),
424
+			'update_item' => __('Update Course Category', 'woothemes-sensei'),
425
+			'add_new_item' => __('Add New Course Category', 'woothemes-sensei'),
426
+			'new_item_name' => __('New Course Category Name', 'woothemes-sensei'),
427
+			'menu_name' => __('Course Categories', 'woothemes-sensei'),
428 428
 			'popular_items' => null // Hides the "Popular" section above the "add" form in the admin.
429 429
 		);
430 430
 
@@ -439,10 +439,10 @@  discard block
 block discarded – undo
439 439
                 'edit_terms'   => 'edit_courses',
440 440
                 'delete_terms' => 'manage_categories',
441 441
                 'assign_terms' => 'edit_courses',),
442
-			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_course_category_slug', _x( 'course-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
442
+			'rewrite' => array('slug' => esc_attr(apply_filters('sensei_course_category_slug', _x('course-category', 'taxonomy archive slug', 'woothemes-sensei'))))
443 443
 		);
444 444
 
445
-		register_taxonomy( 'course-category', array( 'course' ), $args );
445
+		register_taxonomy('course-category', array('course'), $args);
446 446
 
447 447
 	} // End setup_course_category_taxonomy()
448 448
 
@@ -451,20 +451,20 @@  discard block
 block discarded – undo
451 451
 	 * @since  1.0.0
452 452
 	 * @return void
453 453
 	 */
454
-	public function setup_quiz_type_taxonomy () {
454
+	public function setup_quiz_type_taxonomy() {
455 455
 		// "Quiz Types" Custom Taxonomy
456 456
 		$labels = array(
457
-			'name' => _x( 'Quiz Types', 'taxonomy general name', 'woothemes-sensei' ),
458
-			'singular_name' => _x( 'Quiz Type', 'taxonomy singular name', 'woothemes-sensei' ),
459
-			'search_items' =>  __( 'Search Quiz Types', 'woothemes-sensei' ),
460
-			'all_items' => __( 'All Quiz Types', 'woothemes-sensei' ),
461
-			'parent_item' => __( 'Parent Quiz Type', 'woothemes-sensei' ),
462
-			'parent_item_colon' => __( 'Parent Quiz Type:', 'woothemes-sensei' ),
463
-			'edit_item' => __( 'Edit Quiz Type', 'woothemes-sensei' ),
464
-			'update_item' => __( 'Update Quiz Type', 'woothemes-sensei' ),
465
-			'add_new_item' => __( 'Add New Quiz Type', 'woothemes-sensei' ),
466
-			'new_item_name' => __( 'New Quiz Type Name', 'woothemes-sensei' ),
467
-			'menu_name' => __( 'Quiz Types', 'woothemes-sensei' ),
457
+			'name' => _x('Quiz Types', 'taxonomy general name', 'woothemes-sensei'),
458
+			'singular_name' => _x('Quiz Type', 'taxonomy singular name', 'woothemes-sensei'),
459
+			'search_items' =>  __('Search Quiz Types', 'woothemes-sensei'),
460
+			'all_items' => __('All Quiz Types', 'woothemes-sensei'),
461
+			'parent_item' => __('Parent Quiz Type', 'woothemes-sensei'),
462
+			'parent_item_colon' => __('Parent Quiz Type:', 'woothemes-sensei'),
463
+			'edit_item' => __('Edit Quiz Type', 'woothemes-sensei'),
464
+			'update_item' => __('Update Quiz Type', 'woothemes-sensei'),
465
+			'add_new_item' => __('Add New Quiz Type', 'woothemes-sensei'),
466
+			'new_item_name' => __('New Quiz Type Name', 'woothemes-sensei'),
467
+			'menu_name' => __('Quiz Types', 'woothemes-sensei'),
468 468
 			'popular_items' => null // Hides the "Popular" section above the "add" form in the admin.
469 469
 		);
470 470
 
@@ -475,10 +475,10 @@  discard block
 block discarded – undo
475 475
 			'query_var' => true,
476 476
 			'show_in_nav_menus' => false,
477 477
             'public' => false,
478
-			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_quiz_type_slug', _x( 'quiz-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
478
+			'rewrite' => array('slug' => esc_attr(apply_filters('sensei_quiz_type_slug', _x('quiz-type', 'taxonomy archive slug', 'woothemes-sensei'))))
479 479
 		);
480 480
 
481
-		register_taxonomy( 'quiz-type', array( 'quiz' ), $args );
481
+		register_taxonomy('quiz-type', array('quiz'), $args);
482 482
 	} // End setup_quiz_type_taxonomy()
483 483
 
484 484
 	/**
@@ -486,20 +486,20 @@  discard block
 block discarded – undo
486 486
 	 * @since  1.3.0
487 487
 	 * @return void
488 488
 	 */
489
-	public function setup_question_type_taxonomy () {
489
+	public function setup_question_type_taxonomy() {
490 490
 		// "Question Types" Custom Taxonomy
491 491
 		$labels = array(
492
-			'name' => _x( 'Question Types', 'taxonomy general name', 'woothemes-sensei' ),
493
-			'singular_name' => _x( 'Question Type', 'taxonomy singular name', 'woothemes-sensei' ),
494
-			'search_items' =>  __( 'Search Question Types', 'woothemes-sensei' ),
495
-			'all_items' => __( 'All Question Types', 'woothemes-sensei' ),
496
-			'parent_item' => __( 'Parent Question Type', 'woothemes-sensei' ),
497
-			'parent_item_colon' => __( 'Parent Question Type:', 'woothemes-sensei' ),
498
-			'edit_item' => __( 'Edit Question Type', 'woothemes-sensei' ),
499
-			'update_item' => __( 'Update Question Type', 'woothemes-sensei' ),
500
-			'add_new_item' => __( 'Add New Question Type', 'woothemes-sensei' ),
501
-			'new_item_name' => __( 'New Question Type Name', 'woothemes-sensei' ),
502
-			'menu_name' => __( 'Question Types', 'woothemes-sensei' ),
492
+			'name' => _x('Question Types', 'taxonomy general name', 'woothemes-sensei'),
493
+			'singular_name' => _x('Question Type', 'taxonomy singular name', 'woothemes-sensei'),
494
+			'search_items' =>  __('Search Question Types', 'woothemes-sensei'),
495
+			'all_items' => __('All Question Types', 'woothemes-sensei'),
496
+			'parent_item' => __('Parent Question Type', 'woothemes-sensei'),
497
+			'parent_item_colon' => __('Parent Question Type:', 'woothemes-sensei'),
498
+			'edit_item' => __('Edit Question Type', 'woothemes-sensei'),
499
+			'update_item' => __('Update Question Type', 'woothemes-sensei'),
500
+			'add_new_item' => __('Add New Question Type', 'woothemes-sensei'),
501
+			'new_item_name' => __('New Question Type Name', 'woothemes-sensei'),
502
+			'menu_name' => __('Question Types', 'woothemes-sensei'),
503 503
 			'popular_items' => null // Hides the "Popular" section above the "add" form in the admin.
504 504
 		);
505 505
 
@@ -511,10 +511,10 @@  discard block
 block discarded – undo
511 511
 			'query_var' => false,
512 512
 			'show_in_nav_menus' => false,
513 513
 			'show_admin_column' => true,
514
-			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_type_slug', _x( 'question-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
514
+			'rewrite' => array('slug' => esc_attr(apply_filters('sensei_question_type_slug', _x('question-type', 'taxonomy archive slug', 'woothemes-sensei'))))
515 515
 		);
516 516
 
517
-		register_taxonomy( 'question-type', array( 'question' ), $args );
517
+		register_taxonomy('question-type', array('question'), $args);
518 518
 	} // End setup_question_type_taxonomy()
519 519
 
520 520
 	/**
@@ -522,20 +522,20 @@  discard block
 block discarded – undo
522 522
 	 * @since  1.3.0
523 523
 	 * @return void
524 524
 	 */
525
-	public function setup_question_category_taxonomy () {
525
+	public function setup_question_category_taxonomy() {
526 526
 		// "Question Categories" Custom Taxonomy
527 527
 		$labels = array(
528
-			'name' => _x( 'Question Categories', 'taxonomy general name', 'woothemes-sensei' ),
529
-			'singular_name' => _x( 'Question Category', 'taxonomy singular name', 'woothemes-sensei' ),
530
-			'search_items' =>  __( 'Search Question Categories', 'woothemes-sensei' ),
531
-			'all_items' => __( 'All Question Categories', 'woothemes-sensei' ),
532
-			'parent_item' => __( 'Parent Question Category', 'woothemes-sensei' ),
533
-			'parent_item_colon' => __( 'Parent Question Category:', 'woothemes-sensei' ),
534
-			'edit_item' => __( 'Edit Question Category', 'woothemes-sensei' ),
535
-			'update_item' => __( 'Update Question Category', 'woothemes-sensei' ),
536
-			'add_new_item' => __( 'Add New Question Category', 'woothemes-sensei' ),
537
-			'new_item_name' => __( 'New Question Category Name', 'woothemes-sensei' ),
538
-			'menu_name' => __( 'Categories', 'woothemes-sensei' ),
528
+			'name' => _x('Question Categories', 'taxonomy general name', 'woothemes-sensei'),
529
+			'singular_name' => _x('Question Category', 'taxonomy singular name', 'woothemes-sensei'),
530
+			'search_items' =>  __('Search Question Categories', 'woothemes-sensei'),
531
+			'all_items' => __('All Question Categories', 'woothemes-sensei'),
532
+			'parent_item' => __('Parent Question Category', 'woothemes-sensei'),
533
+			'parent_item_colon' => __('Parent Question Category:', 'woothemes-sensei'),
534
+			'edit_item' => __('Edit Question Category', 'woothemes-sensei'),
535
+			'update_item' => __('Update Question Category', 'woothemes-sensei'),
536
+			'add_new_item' => __('Add New Question Category', 'woothemes-sensei'),
537
+			'new_item_name' => __('New Question Category Name', 'woothemes-sensei'),
538
+			'menu_name' => __('Categories', 'woothemes-sensei'),
539 539
 		);
540 540
 
541 541
 		$args = array(
@@ -551,10 +551,10 @@  discard block
 block discarded – undo
551 551
                 'edit_terms'   => 'edit_questions',
552 552
                 'delete_terms' => 'manage_categories',
553 553
                 'assign_terms' => 'edit_questions',),
554
-			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_category_slug', _x( 'question-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
554
+			'rewrite' => array('slug' => esc_attr(apply_filters('sensei_question_category_slug', _x('question-category', 'taxonomy archive slug', 'woothemes-sensei'))))
555 555
 		);
556 556
 
557
-		register_taxonomy( 'question-category', array( 'question' ), $args );
557
+		register_taxonomy('question-category', array('question'), $args);
558 558
 	} // End setup_question_type_taxonomy()
559 559
 
560 560
 	/**
@@ -562,20 +562,20 @@  discard block
 block discarded – undo
562 562
 	 * @since  1.5.0
563 563
 	 * @return void
564 564
 	 */
565
-	public function setup_lesson_tag_taxonomy () {
565
+	public function setup_lesson_tag_taxonomy() {
566 566
 		// "Lesson Tags" Custom Taxonomy
567 567
 		$labels = array(
568
-			'name' => _x( 'Lesson Tags', 'taxonomy general name', 'woothemes-sensei' ),
569
-			'singular_name' => _x( 'Lesson Tag', 'taxonomy singular name', 'woothemes-sensei' ),
570
-			'search_items' =>  __( 'Search Lesson Tags', 'woothemes-sensei' ),
571
-			'all_items' => __( 'All Lesson Tags', 'woothemes-sensei' ),
572
-			'parent_item' => __( 'Parent Tag', 'woothemes-sensei' ),
573
-			'parent_item_colon' => __( 'Parent Tag:', 'woothemes-sensei' ),
574
-			'edit_item' => __( 'Edit Lesson Tag', 'woothemes-sensei' ),
575
-			'update_item' => __( 'Update Lesson Tag', 'woothemes-sensei' ),
576
-			'add_new_item' => __( 'Add New Lesson Tag', 'woothemes-sensei' ),
577
-			'new_item_name' => __( 'New Tag Name', 'woothemes-sensei' ),
578
-			'menu_name' => __( 'Lesson Tags', 'woothemes-sensei' )
568
+			'name' => _x('Lesson Tags', 'taxonomy general name', 'woothemes-sensei'),
569
+			'singular_name' => _x('Lesson Tag', 'taxonomy singular name', 'woothemes-sensei'),
570
+			'search_items' =>  __('Search Lesson Tags', 'woothemes-sensei'),
571
+			'all_items' => __('All Lesson Tags', 'woothemes-sensei'),
572
+			'parent_item' => __('Parent Tag', 'woothemes-sensei'),
573
+			'parent_item_colon' => __('Parent Tag:', 'woothemes-sensei'),
574
+			'edit_item' => __('Edit Lesson Tag', 'woothemes-sensei'),
575
+			'update_item' => __('Update Lesson Tag', 'woothemes-sensei'),
576
+			'add_new_item' => __('Add New Lesson Tag', 'woothemes-sensei'),
577
+			'new_item_name' => __('New Tag Name', 'woothemes-sensei'),
578
+			'menu_name' => __('Lesson Tags', 'woothemes-sensei')
579 579
 		);
580 580
 
581 581
 		$args = array(
@@ -589,10 +589,10 @@  discard block
 block discarded – undo
589 589
                 'edit_terms'   => 'edit_lessons',
590 590
                 'delete_terms' => 'manage_categories',
591 591
                 'assign_terms' => 'edit_lessons',),
592
-			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_lesson_tag_slug', _x( 'lesson-tag', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
592
+			'rewrite' => array('slug' => esc_attr(apply_filters('sensei_lesson_tag_slug', _x('lesson-tag', 'taxonomy archive slug', 'woothemes-sensei'))))
593 593
 		);
594 594
 
595
-		register_taxonomy( 'lesson-tag', array( 'lesson' ), $args );
595
+		register_taxonomy('lesson-tag', array('lesson'), $args);
596 596
 	} // End setup_lesson_tag_taxonomy()
597 597
 
598 598
 	/**
@@ -600,15 +600,15 @@  discard block
 block discarded – undo
600 600
 	 * @since  1.0.0
601 601
 	 * @return void
602 602
 	 */
603
-	private function setup_post_type_labels_base () {
604
-		$this->labels = array( 'course' => array(), 'lesson' => array(), 'quiz' => array(), 'question' => array() );
603
+	private function setup_post_type_labels_base() {
604
+		$this->labels = array('course' => array(), 'lesson' => array(), 'quiz' => array(), 'question' => array());
605 605
 
606
-		$this->labels['course'] = array( 'singular' => __( 'Course', 'woothemes-sensei' ), 'plural' => __( 'Courses', 'woothemes-sensei' ), 'menu' => __( 'Courses', 'woothemes-sensei' ) );
607
-		$this->labels['lesson'] = array( 'singular' => __( 'Lesson', 'woothemes-sensei' ), 'plural' => __( 'Lessons', 'woothemes-sensei' ), 'menu' => __( 'Lessons', 'woothemes-sensei' ) );
608
-		$this->labels['quiz'] = array( 'singular' => __( 'Quiz', 'woothemes-sensei' ), 'plural' => __( 'Quizzes', 'woothemes-sensei' ), 'menu' => __( 'Quizzes', 'woothemes-sensei' ) );
609
-		$this->labels['question'] = array( 'singular' => __( 'Question', 'woothemes-sensei' ), 'plural' => __( 'Questions', 'woothemes-sensei' ), 'menu' => __( 'Questions', 'woothemes-sensei' ) );
610
-		$this->labels['multiple_question'] = array( 'singular' => __( 'Multiple Question', 'woothemes-sensei' ), 'plural' => __( 'Multiple Questions', 'woothemes-sensei' ), 'menu' => __( 'Multiple Questions', 'woothemes-sensei' ) );
611
-		$this->labels['sensei_message'] = array( 'singular' => __( 'Message', 'woothemes-sensei' ), 'plural' => __( 'Messages', 'woothemes-sensei' ), 'menu' => __( 'Messages', 'woothemes-sensei' ) );
606
+		$this->labels['course'] = array('singular' => __('Course', 'woothemes-sensei'), 'plural' => __('Courses', 'woothemes-sensei'), 'menu' => __('Courses', 'woothemes-sensei'));
607
+		$this->labels['lesson'] = array('singular' => __('Lesson', 'woothemes-sensei'), 'plural' => __('Lessons', 'woothemes-sensei'), 'menu' => __('Lessons', 'woothemes-sensei'));
608
+		$this->labels['quiz'] = array('singular' => __('Quiz', 'woothemes-sensei'), 'plural' => __('Quizzes', 'woothemes-sensei'), 'menu' => __('Quizzes', 'woothemes-sensei'));
609
+		$this->labels['question'] = array('singular' => __('Question', 'woothemes-sensei'), 'plural' => __('Questions', 'woothemes-sensei'), 'menu' => __('Questions', 'woothemes-sensei'));
610
+		$this->labels['multiple_question'] = array('singular' => __('Multiple Question', 'woothemes-sensei'), 'plural' => __('Multiple Questions', 'woothemes-sensei'), 'menu' => __('Multiple Questions', 'woothemes-sensei'));
611
+		$this->labels['sensei_message'] = array('singular' => __('Message', 'woothemes-sensei'), 'plural' => __('Messages', 'woothemes-sensei'), 'menu' => __('Messages', 'woothemes-sensei'));
612 612
 
613 613
 	} // End setup_post_type_labels_base()
614 614
 
@@ -620,21 +620,21 @@  discard block
 block discarded – undo
620 620
 	 * @param  string $menu     The menu item label
621 621
 	 * @return array            An array of the labels to be used
622 622
 	 */
623
-	private function create_post_type_labels ( $singular, $plural, $menu ) {
623
+	private function create_post_type_labels($singular, $plural, $menu) {
624 624
 		$labels = array(
625
-		    'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ),
626
-		    'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ),
627
-		    'add_new' => __( 'Add New', 'woothemes-sensei' ),
628
-		    'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ),
629
-		    'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ),
630
-		    'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ),
631
-		    'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ),
632
-		    'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ),
633
-		    'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ),
634
-		    'not_found' =>  sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
635
-		    'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
625
+		    'name' => sprintf(_x('%s', 'post type general name', 'woothemes-sensei'), $plural),
626
+		    'singular_name' => sprintf(_x('%s', 'post type singular name', 'woothemes-sensei'), $singular),
627
+		    'add_new' => __('Add New', 'woothemes-sensei'),
628
+		    'add_new_item' => sprintf(__('Add New %s', 'woothemes-sensei'), $singular),
629
+		    'edit_item' => sprintf(__('Edit %s', 'woothemes-sensei'), $singular),
630
+		    'new_item' => sprintf(__('New %s', 'woothemes-sensei'), $singular),
631
+		    'all_items' => sprintf(__('All %s', 'woothemes-sensei'), $plural),
632
+		    'view_item' => sprintf(__('View %s', 'woothemes-sensei'), $singular),
633
+		    'search_items' => sprintf(__('Search %s', 'woothemes-sensei'), $plural),
634
+		    'not_found' =>  sprintf(__('No %s found', 'woothemes-sensei'), mb_strtolower($plural, 'UTF-8')),
635
+		    'not_found_in_trash' => sprintf(__('No %s found in Trash', 'woothemes-sensei'), mb_strtolower($plural, 'UTF-8')),
636 636
 		    'parent_item_colon' => '',
637
-		    'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu )
637
+		    'menu_name' => sprintf(__('%s', 'woothemes-sensei'), $menu)
638 638
 		  );
639 639
 
640 640
 		return $labels;
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
 	 * @param  array $messages The existing array of messages for post types.
647 647
 	 * @return array           The modified array of messages for post types.
648 648
 	 */
649
-	public function setup_post_type_messages ( $messages ) {
649
+	public function setup_post_type_messages($messages) {
650 650
 		global $post, $post_ID;
651 651
 
652
-		$messages['course'] = $this->create_post_type_messages( 'course' );
653
-		$messages['lesson'] = $this->create_post_type_messages( 'lesson' );
654
-		$messages['quiz'] = $this->create_post_type_messages( 'quiz' );
655
-		$messages['question'] = $this->create_post_type_messages( 'question' );
656
-		$messages['multiple_question'] = $this->create_post_type_messages( 'multiple_question' );
652
+		$messages['course'] = $this->create_post_type_messages('course');
653
+		$messages['lesson'] = $this->create_post_type_messages('lesson');
654
+		$messages['quiz'] = $this->create_post_type_messages('quiz');
655
+		$messages['question'] = $this->create_post_type_messages('question');
656
+		$messages['multiple_question'] = $this->create_post_type_messages('multiple_question');
657 657
 
658 658
 		return $messages;
659 659
 	} // End setup_post_type_messages()
@@ -664,23 +664,23 @@  discard block
 block discarded – undo
664 664
 	 * @param  string $post_type The post type for which to create messages.
665 665
 	 * @return array            An array of messages (empty array if the post type isn't one we're looking to work with).
666 666
 	 */
667
-	private function create_post_type_messages ( $post_type ) {
667
+	private function create_post_type_messages($post_type) {
668 668
 		global $post, $post_ID;
669 669
 
670
-		if ( ! isset( $this->labels[$post_type] ) ) { return array(); }
670
+		if ( ! isset($this->labels[$post_type])) { return array(); }
671 671
 
672 672
 		$messages = array(
673 673
 			0 => '',
674
-			1 => sprintf( __( '%1$s updated. %2$sView %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
675
-			2 => __( 'Custom field updated.' , 'woothemes-sensei' ),
676
-			3 => __( 'Custom field deleted.' , 'woothemes-sensei' ),
677
-			4 => sprintf( __( '%1$s updated.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'] ),
678
-			5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
679
-			6 => sprintf( __( '%1$s published. %2$sView %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ),
680
-			7 => sprintf( __( '%1$s saved.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'] ),
681
-			8 => sprintf( __( '%1$s submitted. %2$sPreview %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ),
682
-			9 => sprintf( __( '%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'woothemes-sensei' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', $this->labels[$post_type]['singular'], '</a>' ),
683
-			10 => sprintf( __( '%1$s draft updated. %2$sPreview %3$s%4$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', $this->labels[$post_type]['singular'], '</a>' ),
674
+			1 => sprintf(__('%1$s updated. %2$sView %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a href="'.esc_url(get_permalink($post_ID)).'">', '</a>'),
675
+			2 => __('Custom field updated.', 'woothemes-sensei'),
676
+			3 => __('Custom field deleted.', 'woothemes-sensei'),
677
+			4 => sprintf(__('%1$s updated.', 'woothemes-sensei'), $this->labels[$post_type]['singular']),
678
+			5 => isset($_GET['revision']) ? sprintf(__('%1$s restored to revision from %2$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], wp_post_revision_title((int) $_GET['revision'], false)) : false,
679
+			6 => sprintf(__('%1$s published. %2$sView %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a href="'.esc_url(get_permalink($post_ID)).'">', '</a>'),
680
+			7 => sprintf(__('%1$s saved.', 'woothemes-sensei'), $this->labels[$post_type]['singular']),
681
+			8 => sprintf(__('%1$s submitted. %2$sPreview %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">', '</a>'),
682
+			9 => sprintf(__('%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<strong>'.date_i18n(__('M j, Y @ G:i', 'woothemes-sensei'), strtotime($post->post_date)).'</strong>', '<a target="_blank" href="'.esc_url(get_permalink($post_ID)).'">', $this->labels[$post_type]['singular'], '</a>'),
683
+			10 => sprintf(__('%1$s draft updated. %2$sPreview %3$s%4$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">', $this->labels[$post_type]['singular'], '</a>'),
684 684
 		);
685 685
 
686 686
 		return $messages;
@@ -693,11 +693,11 @@  discard block
 block discarded – undo
693 693
 	 * @param  string $title
694 694
 	 * @return string $title
695 695
 	 */
696
-	public function enter_title_here ( $title ) {
697
-		if ( get_post_type() == 'course' ) {
698
-			$title = __( 'Enter a title for this course here', 'woothemes-sensei' );
699
-		} elseif ( get_post_type() == 'lesson' ) {
700
-			$title = __( 'Enter a title for this lesson here', 'woothemes-sensei' );
696
+	public function enter_title_here($title) {
697
+		if (get_post_type() == 'course') {
698
+			$title = __('Enter a title for this course here', 'woothemes-sensei');
699
+		} elseif (get_post_type() == 'lesson') {
700
+			$title = __('Enter a title for this lesson here', 'woothemes-sensei');
701 701
 		}
702 702
 
703 703
 		return $title;
@@ -711,60 +711,60 @@  discard block
 block discarded – undo
711 711
 	 * @param array $post_types
712 712
 	 * @return void
713 713
 	 */
714
-	public function set_role_cap_defaults( $post_types = array() ) {
714
+	public function set_role_cap_defaults($post_types = array()) {
715 715
 
716
-		foreach ( $post_types as $post_type_item => $post_type_name ) {
716
+		foreach ($post_types as $post_type_item => $post_type_name) {
717 717
 			// Super Admin
718
-			$this->role_caps[] =  array(	'administrator' 	=> array( 	'edit_' . $post_type_item,
719
-																			'read_' . $post_type_item,
720
-																			'delete_' . $post_type_item,
721
-																			'create_' . $post_type_item . 's',
722
-																			'edit_' . $post_type_item . 's',
723
-																			'edit_others_' . $post_type_item . 's',
724
-																			'publish_' . $post_type_item . 's',
725
-																			'read_private_' . $post_type_item . 's',
718
+			$this->role_caps[] = array('administrator' 	=> array('edit_'.$post_type_item,
719
+																			'read_'.$post_type_item,
720
+																			'delete_'.$post_type_item,
721
+																			'create_'.$post_type_item.'s',
722
+																			'edit_'.$post_type_item.'s',
723
+																			'edit_others_'.$post_type_item.'s',
724
+																			'publish_'.$post_type_item.'s',
725
+																			'read_private_'.$post_type_item.'s',
726 726
 																			'read',
727
-																			'delete_' . $post_type_item . 's',
728
-																			'delete_private_' . $post_type_item . 's',
729
-																			'delete_published_' . $post_type_item . 's',
730
-																			'delete_others_' . $post_type_item . 's',
731
-																			'edit_private_' . $post_type_item . 's',
732
-																			'edit_published_' . $post_type_item . 's',
727
+																			'delete_'.$post_type_item.'s',
728
+																			'delete_private_'.$post_type_item.'s',
729
+																			'delete_published_'.$post_type_item.'s',
730
+																			'delete_others_'.$post_type_item.'s',
731
+																			'edit_private_'.$post_type_item.'s',
732
+																			'edit_published_'.$post_type_item.'s',
733 733
 																			'manage_sensei',
734
-																			'manage_sensei_grades' ),
735
-											'editor' 			=> array(	'edit_' . $post_type_item,
736
-																			'read_' . $post_type_item,
737
-																			'delete_' . $post_type_item,
738
-																			'create_' . $post_type_item . 's',
739
-																		 	'edit_' . $post_type_item . 's',
740
-																			'edit_others_' . $post_type_item . 's',
741
-																			'publish_' . $post_type_item . 's',
742
-																			'read_private_' . $post_type_item . 's',
734
+																			'manage_sensei_grades'),
735
+											'editor' 			=> array('edit_'.$post_type_item,
736
+																			'read_'.$post_type_item,
737
+																			'delete_'.$post_type_item,
738
+																			'create_'.$post_type_item.'s',
739
+																		 	'edit_'.$post_type_item.'s',
740
+																			'edit_others_'.$post_type_item.'s',
741
+																			'publish_'.$post_type_item.'s',
742
+																			'read_private_'.$post_type_item.'s',
743 743
 																			'read',
744
-																			'delete_' . $post_type_item . 's',
745
-																			'delete_private_' . $post_type_item . 's',
746
-																			'delete_published_' . $post_type_item . 's',
747
-																			'delete_others_' . $post_type_item . 's',
748
-																			'edit_private_' . $post_type_item . 's',
749
-																			'edit_published_' . $post_type_item . 's' ),
750
-											'author' 			=> array( 	'edit_' . $post_type_item,
751
-																			'read_' . $post_type_item,
752
-																			'delete_' . $post_type_item,
753
-																			'create_' . $post_type_item . 's',
754
-																			'edit_' . $post_type_item . 's',
755
-																			'publish_' . $post_type_item . 's',
744
+																			'delete_'.$post_type_item.'s',
745
+																			'delete_private_'.$post_type_item.'s',
746
+																			'delete_published_'.$post_type_item.'s',
747
+																			'delete_others_'.$post_type_item.'s',
748
+																			'edit_private_'.$post_type_item.'s',
749
+																			'edit_published_'.$post_type_item.'s'),
750
+											'author' 			=> array('edit_'.$post_type_item,
751
+																			'read_'.$post_type_item,
752
+																			'delete_'.$post_type_item,
753
+																			'create_'.$post_type_item.'s',
754
+																			'edit_'.$post_type_item.'s',
755
+																			'publish_'.$post_type_item.'s',
756 756
 																			'read',
757
-																			'delete_' . $post_type_item . 's',
758
-																			'delete_published_' . $post_type_item . 's',
759
-																			'edit_published_' . $post_type_item . 's' ),
760
-											'contributor' 		=> array( 	'edit_' . $post_type_item,
761
-																			'read_' . $post_type_item,
762
-																			'delete_' . $post_type_item,
763
-																			'create_' . $post_type_item . 's',
764
-																			'edit_' . $post_type_item . 's',
757
+																			'delete_'.$post_type_item.'s',
758
+																			'delete_published_'.$post_type_item.'s',
759
+																			'edit_published_'.$post_type_item.'s'),
760
+											'contributor' 		=> array('edit_'.$post_type_item,
761
+																			'read_'.$post_type_item,
762
+																			'delete_'.$post_type_item,
763
+																			'create_'.$post_type_item.'s',
764
+																			'edit_'.$post_type_item.'s',
765 765
 																			'read',
766
-																			'delete_' . $post_type_item . 's' ),
767
-											'subscriber' 		=> array( 	'read' )
766
+																			'delete_'.$post_type_item.'s'),
767
+											'subscriber' 		=> array('read')
768 768
 
769 769
 										);
770 770
 		} // End For Loop
@@ -778,16 +778,16 @@  discard block
 block discarded – undo
778 778
      * @param WP_Admin_Bar $bar
779 779
 	 * @return void
780 780
 	 */
781
-	public function quiz_admin_bar_menu( $bar ) {
782
-		if ( is_single() && 'quiz' == get_queried_object()->post_type ) {
783
-			$lesson_id = get_post_meta( get_queried_object()->ID, '_quiz_lesson', true );
784
-			if ( $lesson_id ) {
781
+	public function quiz_admin_bar_menu($bar) {
782
+		if (is_single() && 'quiz' == get_queried_object()->post_type) {
783
+			$lesson_id = get_post_meta(get_queried_object()->ID, '_quiz_lesson', true);
784
+			if ($lesson_id) {
785 785
 				$object_type = get_post_type_object('quiz');
786
-				$bar->add_menu( array(
786
+				$bar->add_menu(array(
787 787
 					'id' => 'edit',
788 788
 					'title' => $object_type->labels->edit_item,
789
-					'href' => get_edit_post_link( $lesson_id ),
790
-				) );
789
+					'href' => get_edit_post_link($lesson_id),
790
+				));
791 791
 			}
792 792
 		}
793 793
 	}
@@ -799,4 +799,4 @@  discard block
 block discarded – undo
799 799
  * for backward compatibility
800 800
  * @since 1.9.0
801 801
  */
802
-class WooThemes_Sensei_PostTypes extends Sensei_PostTypes{}
802
+class WooThemes_Sensei_PostTypes extends Sensei_PostTypes {}
Please login to merge, or discard this patch.
includes/theme-integrations/theme-integration-loader.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      *
36 36
      * @since 1.9.0
37 37
      */
38
-    private function setup_themes(){
38
+    private function setup_themes() {
39 39
 
40 40
         $this->themes = array(
41 41
             'twentyeleven',
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      *
55 55
      * @since 1.9.0
56 56
      */
57
-    private function setup_currently_active_theme(){
57
+    private function setup_currently_active_theme() {
58 58
 
59 59
         $this->active_theme = get_option('template');
60 60
 
@@ -67,33 +67,33 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @since 1.9.0
69 69
      */
70
-    private function possibly_load_supported_theme_wrappers(){
70
+    private function possibly_load_supported_theme_wrappers() {
71 71
 
72
-        if ( in_array( $this->active_theme, $this->themes ) ){
72
+        if (in_array($this->active_theme, $this->themes)) {
73 73
 
74 74
             // setup file and class names
75
-            $supported_theme_class_file = trailingslashit( Sensei()->plugin_path ) . 'includes/theme-integrations/' . $this->active_theme . '.php';
76
-            $supported_theme_class_name  = 'Sensei_'. ucfirst( $this->active_theme  );
75
+            $supported_theme_class_file = trailingslashit(Sensei()->plugin_path).'includes/theme-integrations/'.$this->active_theme.'.php';
76
+            $supported_theme_class_name = 'Sensei_'.ucfirst($this->active_theme);
77 77
 
78 78
             // load the file or exit if there is no file for this theme
79
-            if( ! file_exists( $supported_theme_class_file ) ){
79
+            if ( ! file_exists($supported_theme_class_file)) {
80 80
                 return;
81 81
             }
82
-            include_once( $supported_theme_class_file );
83
-            include_once( 'twentytwelve.php' );
82
+            include_once($supported_theme_class_file);
83
+            include_once('twentytwelve.php');
84 84
             //initialize the class or exit if there is no class for this theme
85
-            if( ! class_exists( $supported_theme_class_name ) ){
85
+            if ( ! class_exists($supported_theme_class_name)) {
86 86
                 return;
87 87
             }
88 88
             $supported_theme = new $supported_theme_class_name;
89 89
 
90 90
             // remove default wrappers
91
-            remove_action( 'sensei_before_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper' ), 10 );
92
-            remove_action( 'sensei_after_main_content', array( Sensei()->frontend, 'sensei_output_content_wrapper_end' ), 10 );
91
+            remove_action('sensei_before_main_content', array(Sensei()->frontend, 'sensei_output_content_wrapper'), 10);
92
+            remove_action('sensei_after_main_content', array(Sensei()->frontend, 'sensei_output_content_wrapper_end'), 10);
93 93
 
94 94
             // load the supported theme wrappers
95
-            add_action( 'sensei_before_main_content', array( $supported_theme, 'wrapper_start' ), 10 );
96
-            add_action( 'sensei_after_main_content', array( $supported_theme, 'wrapper_end' ), 10 );
95
+            add_action('sensei_before_main_content', array($supported_theme, 'wrapper_start'), 10);
96
+            add_action('sensei_after_main_content', array($supported_theme, 'wrapper_end'), 10);
97 97
         }
98 98
     }
99 99
 
Please login to merge, or discard this patch.
includes/theme-integrations/twentyfifteen.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * Output opening wrappers
14 14
      * @since 1.9.0
15 15
      */
16
-    public function wrapper_start(){
16
+    public function wrapper_start() {
17 17
 
18 18
         // output inline styles
19 19
         $this->print_styles();
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @since 1.9.0
32 32
      */
33
-    private function print_styles(){?>
33
+    private function print_styles() {?>
34 34
 
35 35
         <style>
36 36
             @media screen and (min-width: 59.6875em){
Please login to merge, or discard this patch.
includes/theme-integrations/_s.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * Output opening wrappers
14 14
      * @since 1.9.0
15 15
      */
16
-    public function wrapper_start(){ ?>
16
+    public function wrapper_start() { ?>
17 17
         <div id="primary" class="content-area">
18 18
             <main id="main" class="site-main" role="main">
19 19
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      *
25 25
      * @since 1.9.0
26 26
      */
27
-    public function wrapper_end(){ ?>
27
+    public function wrapper_end() { ?>
28 28
 
29 29
             </main> <!-- main-site -->
30 30
           </div> <!-- content-area -->
Please login to merge, or discard this patch.
includes/theme-integrations/twentythirteen.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * Output opening wrappers
14 14
      * @since 1.9.0
15 15
      */
16
-    public function wrapper_start(){
16
+    public function wrapper_start() {
17 17
     ?>
18 18
 
19 19
         <div id="primary" class="site-content">
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @since 1.9.0
28 28
      */
29
-    public function wrapper_end(){ ?>
29
+    public function wrapper_end() { ?>
30 30
 
31 31
 			</div>
32 32
 		</div>
Please login to merge, or discard this patch.
includes/theme-integrations/twentysixteen.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,4 +7,4 @@
 block discarded – undo
7 7
  *
8 8
  * @since 1.9.0
9 9
 */
10
-Class Sensei_Twentysixteen extends Sensei__S{ }
10
+Class Sensei_Twentysixteen extends Sensei__S { }
Please login to merge, or discard this patch.
templates/globals/wrapper-end.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit;
2
+if ( ! defined('ABSPATH')) exit;
3 3
 /**
4 4
  * Content wrappers
5 5
  *
Please login to merge, or discard this patch.
includes/theme-integrations/twentyeleven.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * Output opening wrappers
14 14
      * @since 1.9.0
15 15
      */
16
-    public function wrapper_start(){
16
+    public function wrapper_start() {
17 17
     ?>
18 18
 
19 19
         <div id="primary" class="site-content">
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @since 1.9.0
28 28
      */
29
-    public function wrapper_end(){ ?>
29
+    public function wrapper_end() { ?>
30 30
 
31 31
 			</div>
32 32
 		</div>
Please login to merge, or discard this patch.