Completed
Push — master ( d3c307...d2b88c )
by Dwain
05:56
created
includes/class-sensei-posttypes.php 1 patch
Indentation   +245 added lines, -245 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@  discard block
 block discarded – undo
16 16
 	public $slider_labels;
17 17
 	public $role_caps;
18 18
 
19
-    /**
20
-     * @var Sensei_Course
21
-     */
22
-    public $course;
23
-
24
-    /**
25
-     * @var Sensei_Lesson
26
-     */
27
-    public $lesson;
28
-
29
-    /**
30
-     * @var Sensei_Question
31
-     */
32
-    public $question;
33
-
34
-    /**
35
-     * @var Sensei_Quiz
36
-     */
37
-    public $quiz;
19
+	/**
20
+	 * @var Sensei_Course
21
+	 */
22
+	public $course;
23
+
24
+	/**
25
+	 * @var Sensei_Lesson
26
+	 */
27
+	public $lesson;
28
+
29
+	/**
30
+	 * @var Sensei_Question
31
+	 */
32
+	public $question;
33
+
34
+	/**
35
+	 * @var Sensei_Quiz
36
+	 */
37
+	public $quiz;
38 38
 
39 39
 	/**
40 40
 	 * Constructor
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 		// Setup Post Types
46 46
 		$this->labels = array();
47
-        $this->token = 'woothemes-sensei-posttypes';
47
+		$this->token = 'woothemes-sensei-posttypes';
48 48
 
49 49
 		$this->setup_post_type_labels_base();
50 50
 		add_action( 'init', array( $this, 'setup_course_post_type' ), 100 );
@@ -103,94 +103,94 @@  discard block
 block discarded – undo
103 103
 	/**
104 104
 	 * Setup the "course" post type, it's admin menu item and the appropriate labels and permissions.
105 105
 	 * @since  1.0.0
106
-     * @uses  Sensei()
106
+	 * @uses  Sensei()
107 107
 	 * @return void
108 108
 	 */
109 109
 	public function setup_course_post_type () {
110 110
 
111 111
 		$args = array(
112
-		    'labels'              => $this->create_post_type_labels( $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ),
113
-		    'public'              => true,
114
-		    'publicly_queryable'  => true,
115
-		    'show_ui'             => true,
116
-		    'show_in_menu'        => true,
117
-		    'show_in_admin_bar'   => true,
118
-		    'query_var'           => true,
119
-		    'rewrite'             => array(
120
-                'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) ,
121
-                'with_front' => true,
122
-                'feeds' => true,
123
-                'pages' => true
124
-            ),
125
-		    'map_meta_cap'        => true,
126
-		    'capability_type'     => 'course',
127
-            'has_archive'         => $this->get_course_post_type_archive_slug(),
128
-		    'hierarchical'        => false,
129
-		    'menu_position'       => 51,
130
-		    'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail' )
112
+			'labels'              => $this->create_post_type_labels( $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ),
113
+			'public'              => true,
114
+			'publicly_queryable'  => true,
115
+			'show_ui'             => true,
116
+			'show_in_menu'        => true,
117
+			'show_in_admin_bar'   => true,
118
+			'query_var'           => true,
119
+			'rewrite'             => array(
120
+				'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) ,
121
+				'with_front' => true,
122
+				'feeds' => true,
123
+				'pages' => true
124
+			),
125
+			'map_meta_cap'        => true,
126
+			'capability_type'     => 'course',
127
+			'has_archive'         => $this->get_course_post_type_archive_slug(),
128
+			'hierarchical'        => false,
129
+			'menu_position'       => 51,
130
+			'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail' )
131 131
 		);
132 132
 
133
-        /**
134
-         * Filter the arguments passed in when registering the Sensei Course post type.
135
-         *
136
-         * @since 1.9.0
137
-         * @param array $args
138
-         */
133
+		/**
134
+		 * Filter the arguments passed in when registering the Sensei Course post type.
135
+		 *
136
+		 * @since 1.9.0
137
+		 * @param array $args
138
+		 */
139 139
 		register_post_type( 'course', apply_filters( 'sensei_register_post_type_course', $args ) );
140 140
 
141 141
 	} // End setup_course_post_type()
142 142
 
143
-    /**
144
-     * Figure out of the course post type has an archive and what it should be.
145
-     *
146
-     * This function should return 'courses' or the page_uri for the course page setting.
147
-     *
148
-     * For backward compatibility  sake ( pre 1.9 )If the course page set in settings
149
-     * still has any of the old shortcodes: [newcourses][featuredcourses][freecourses][paidcourses] the
150
-     * page slug will not be returned. For any other pages without it the page URI will be returned.
151
-     *
152
-     *
153
-     * @sine 1.9.0
154
-     *
155
-     *
156
-     * @return false|string
157
-     */
158
-    public function get_course_post_type_archive_slug(){
143
+	/**
144
+	 * Figure out of the course post type has an archive and what it should be.
145
+	 *
146
+	 * This function should return 'courses' or the page_uri for the course page setting.
147
+	 *
148
+	 * For backward compatibility  sake ( pre 1.9 )If the course page set in settings
149
+	 * still has any of the old shortcodes: [newcourses][featuredcourses][freecourses][paidcourses] the
150
+	 * page slug will not be returned. For any other pages without it the page URI will be returned.
151
+	 *
152
+	 *
153
+	 * @sine 1.9.0
154
+	 *
155
+	 *
156
+	 * @return false|string
157
+	 */
158
+	public function get_course_post_type_archive_slug(){
159 159
 
160
-        $settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) );
160
+		$settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) );
161 161
 
162
-        // for a valid post that doesn't have any of the old short codes set the archive the same
163
-        // as the page URI
164
-        if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){
162
+		// for a valid post that doesn't have any of the old short codes set the archive the same
163
+		// as the page URI
164
+		if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){
165 165
 
166
-             return get_page_uri( $settings_course_page->ID );
166
+			 return get_page_uri( $settings_course_page->ID );
167 167
 
168
-        }else{
168
+		}else{
169 169
 
170
-            return 'courses';
170
+			return 'courses';
171 171
 
172
-        }
172
+		}
173 173
 
174
-    }// end course_post_type_determine_archive
174
+	}// end course_post_type_determine_archive
175 175
 
176
-    /**
177
-     * Check if given content has any of these old shortcodes:
178
-     * [newcourses][featuredcourses][freecourses][paidcourses]
179
-     *
180
-     * @since 1.9.0
181
-     *
182
-     * @param string $content
183
-     *
184
-     * @return bool
185
-     */
186
-    public function has_old_shortcodes( $content ){
176
+	/**
177
+	 * Check if given content has any of these old shortcodes:
178
+	 * [newcourses][featuredcourses][freecourses][paidcourses]
179
+	 *
180
+	 * @since 1.9.0
181
+	 *
182
+	 * @param string $content
183
+	 *
184
+	 * @return bool
185
+	 */
186
+	public function has_old_shortcodes( $content ){
187 187
 
188
-        return  ( has_shortcode( $content, 'newcourses')
189
-        || has_shortcode( $content, 'featuredcourses')
190
-        || has_shortcode( $content, 'freecourses')
191
-        || has_shortcode( $content, 'paidcourses') );
188
+		return  ( has_shortcode( $content, 'newcourses')
189
+		|| has_shortcode( $content, 'featuredcourses')
190
+		|| has_shortcode( $content, 'freecourses')
191
+		|| has_shortcode( $content, 'paidcourses') );
192 192
 
193
-    }// end has old shortcodes
193
+	}// end has old shortcodes
194 194
 
195 195
 
196 196
 	/**
@@ -211,32 +211,32 @@  discard block
 block discarded – undo
211 211
 		} // End If Statement
212 212
 
213 213
 		$args = array(
214
-		    'labels' => $this->create_post_type_labels(  $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ),
215
-		    'public' => true,
216
-		    'publicly_queryable' => true,
217
-		    'show_ui' => true,
218
-		    'show_in_menu' => true,
219
-		    'query_var' => true,
220
-		    'rewrite' => array(
221
-                'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) ,
222
-                'with_front' =>  true,
223
-                'feeds' => true,
224
-                'pages' => true
225
-            ),
226
-		    'map_meta_cap' => true,
227
-		    'capability_type' => 'lesson',
228
-		    'has_archive' => true,
229
-		    'hierarchical' => false,
230
-		    'menu_position' => 52,
231
-		    'supports' => $supports_array
214
+			'labels' => $this->create_post_type_labels(  $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ),
215
+			'public' => true,
216
+			'publicly_queryable' => true,
217
+			'show_ui' => true,
218
+			'show_in_menu' => true,
219
+			'query_var' => true,
220
+			'rewrite' => array(
221
+				'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) ,
222
+				'with_front' =>  true,
223
+				'feeds' => true,
224
+				'pages' => true
225
+			),
226
+			'map_meta_cap' => true,
227
+			'capability_type' => 'lesson',
228
+			'has_archive' => true,
229
+			'hierarchical' => false,
230
+			'menu_position' => 52,
231
+			'supports' => $supports_array
232 232
 		);
233 233
 
234
-        /**
235
-         * Filter the arguments passed in when registering the Sensei Lesson post type.
236
-         *
237
-         * @since 1.9.0
238
-         * @param array $args
239
-         */
234
+		/**
235
+		 * Filter the arguments passed in when registering the Sensei Lesson post type.
236
+		 *
237
+		 * @since 1.9.0
238
+		 * @param array $args
239
+		 */
240 240
 		register_post_type( 'lesson', apply_filters( 'sensei_register_post_type_lesson', $args ) );
241 241
 
242 242
 	} // End setup_lesson_post_type()
@@ -244,44 +244,44 @@  discard block
 block discarded – undo
244 244
 	/**
245 245
 	 * Setup the "quiz" post type, it's admin menu item and the appropriate labels and permissions.
246 246
 	 * @since  1.0.0
247
-     * @uses  Sensei()
247
+	 * @uses  Sensei()
248 248
 	 * @return void
249 249
 	 */
250 250
 	public function setup_quiz_post_type () {
251 251
 
252 252
 		$args = array(
253
-		    'labels' => $this->create_post_type_labels(
254
-                $this->labels['quiz']['singular'],
255
-                $this->labels['quiz']['plural'],
256
-                $this->labels['quiz']['menu']
257
-            ),
258
-		    'public' => true,
259
-		    'publicly_queryable' => true,
260
-		    'show_ui' => true,
261
-		    'show_in_menu' => false,
262
-		    'show_in_nav_menus' => false,
263
-		    'query_var' => true,
264
-		    'exclude_from_search' => true,
265
-		    'rewrite' => array(
266
-                'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) ,
267
-                'with_front' =>  true,
268
-                'feeds' => true,
269
-                'pages' => true
270
-            ),
271
-		    'map_meta_cap' => true,
272
-		    'capability_type' => 'quiz',
273
-		    'has_archive' => false,
274
-		    'hierarchical' => false,
275
-		    'menu_position' => 20, // Below "Pages"
276
-		    'supports' => array( '' )
253
+			'labels' => $this->create_post_type_labels(
254
+				$this->labels['quiz']['singular'],
255
+				$this->labels['quiz']['plural'],
256
+				$this->labels['quiz']['menu']
257
+			),
258
+			'public' => true,
259
+			'publicly_queryable' => true,
260
+			'show_ui' => true,
261
+			'show_in_menu' => false,
262
+			'show_in_nav_menus' => false,
263
+			'query_var' => true,
264
+			'exclude_from_search' => true,
265
+			'rewrite' => array(
266
+				'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) ,
267
+				'with_front' =>  true,
268
+				'feeds' => true,
269
+				'pages' => true
270
+			),
271
+			'map_meta_cap' => true,
272
+			'capability_type' => 'quiz',
273
+			'has_archive' => false,
274
+			'hierarchical' => false,
275
+			'menu_position' => 20, // Below "Pages"
276
+			'supports' => array( '' )
277 277
 		);
278 278
 
279
-        /**
280
-         * Filter the arguments passed in when registering the Sensei Quiz post type.
281
-         *
282
-         * @since 1.9.0
283
-         * @param array $args
284
-         */
279
+		/**
280
+		 * Filter the arguments passed in when registering the Sensei Quiz post type.
281
+		 *
282
+		 * @since 1.9.0
283
+		 * @param array $args
284
+		 */
285 285
 		register_post_type( 'quiz', apply_filters( 'sensei_register_post_type_quiz', $args ) );
286 286
 
287 287
 	} // End setup_quiz_post_type()
@@ -295,34 +295,34 @@  discard block
 block discarded – undo
295 295
 	public function setup_question_post_type () {
296 296
 
297 297
 		$args = array(
298
-		    'labels' => $this->create_post_type_labels( $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ),
299
-		    'public' => false,
300
-		    'publicly_queryable' => true,
301
-		    'show_ui' => true,
302
-		    'show_in_menu' => true,
303
-		    'show_in_nav_menus' => false,
304
-		    'query_var' => true,
305
-		    'exclude_from_search' => true,
306
-		    'rewrite' => array(
307
-                'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
308
-                'with_front' =>  true,
309
-                'feeds' => true,
310
-                'pages' => true
311
-            ),
312
-		    'map_meta_cap' => true,
313
-		    'capability_type' => 'question',
314
-		    'has_archive' => true,
315
-		    'hierarchical' => false,
316
-		    'menu_position' => 51,
317
-		    'supports' => array( 'title' )
298
+			'labels' => $this->create_post_type_labels( $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ),
299
+			'public' => false,
300
+			'publicly_queryable' => true,
301
+			'show_ui' => true,
302
+			'show_in_menu' => true,
303
+			'show_in_nav_menus' => false,
304
+			'query_var' => true,
305
+			'exclude_from_search' => true,
306
+			'rewrite' => array(
307
+				'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
308
+				'with_front' =>  true,
309
+				'feeds' => true,
310
+				'pages' => true
311
+			),
312
+			'map_meta_cap' => true,
313
+			'capability_type' => 'question',
314
+			'has_archive' => true,
315
+			'hierarchical' => false,
316
+			'menu_position' => 51,
317
+			'supports' => array( 'title' )
318 318
 		);
319 319
 
320
-        /**
321
-         * Filter the arguments passed in when registering the Sensei Question post type.
322
-         *
323
-         * @since 1.9.0
324
-         * @param array $args
325
-         */
320
+		/**
321
+		 * Filter the arguments passed in when registering the Sensei Question post type.
322
+		 *
323
+		 * @since 1.9.0
324
+		 * @param array $args
325
+		 */
326 326
 		register_post_type( 'question', apply_filters('sensei_register_post_type_question', $args ) );
327 327
 
328 328
 	} // End setup_question_post_type()
@@ -335,26 +335,26 @@  discard block
 block discarded – undo
335 335
 	public function setup_multiple_question_post_type () {
336 336
 
337 337
 		$args = array(
338
-		    'labels' => $this->create_post_type_labels( $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ),
339
-		    'public' => false,
340
-		    'publicly_queryable' => false,
341
-		    'show_ui' => false,
342
-		    'show_in_menu' => false,
343
-		    'show_in_nav_menus' => false,
344
-		    'query_var' => false,
345
-		    'exclude_from_search' => true,
346
-		    'rewrite' => array(
347
-                'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
348
-                'with_front' =>  false,
349
-                'feeds' => false,
350
-                'pages' => false
351
-            ),
352
-		    'map_meta_cap' => true,
353
-		    'capability_type' => 'question',
354
-		    'has_archive' => false,
355
-		    'hierarchical' => false,
356
-		    'menu_position' => 51,
357
-		    'supports' => array( 'title', 'custom-fields' )
338
+			'labels' => $this->create_post_type_labels( $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ),
339
+			'public' => false,
340
+			'publicly_queryable' => false,
341
+			'show_ui' => false,
342
+			'show_in_menu' => false,
343
+			'show_in_nav_menus' => false,
344
+			'query_var' => false,
345
+			'exclude_from_search' => true,
346
+			'rewrite' => array(
347
+				'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) ,
348
+				'with_front' =>  false,
349
+				'feeds' => false,
350
+				'pages' => false
351
+			),
352
+			'map_meta_cap' => true,
353
+			'capability_type' => 'question',
354
+			'has_archive' => false,
355
+			'hierarchical' => false,
356
+			'menu_position' => 51,
357
+			'supports' => array( 'title', 'custom-fields' )
358 358
 		);
359 359
 
360 360
 		register_post_type( 'multiple_question', $args );
@@ -370,34 +370,34 @@  discard block
 block discarded – undo
370 370
 		if( ! isset( Sensei()->settings->settings['messages_disable'] ) || ! Sensei()->settings->settings['messages_disable'] ) {
371 371
 
372 372
 			$args = array(
373
-			    'labels' => $this->create_post_type_labels( $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ),
374
-			    'public' => true,
375
-			    'publicly_queryable' => true,
376
-			    'show_ui' => true,
377
-			    'show_in_menu' => 'admin.php?page=sensei',
378
-			    'show_in_nav_menus' => true,
379
-			    'query_var' => true,
380
-			    'exclude_from_search' => true,
381
-			    'rewrite' => array(
382
-                    'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) ,
383
-                    'with_front' =>  false,
384
-                    'feeds' => false,
385
-                    'pages' => true
386
-                ),
387
-			    'map_meta_cap' => true,
388
-			    'capability_type' => 'question',
389
-			    'has_archive' => true,
390
-			    'hierarchical' => false,
391
-			    'menu_position' => 50,
392
-			    'supports' => array( 'title', 'editor', 'comments' ),
373
+				'labels' => $this->create_post_type_labels( $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ),
374
+				'public' => true,
375
+				'publicly_queryable' => true,
376
+				'show_ui' => true,
377
+				'show_in_menu' => 'admin.php?page=sensei',
378
+				'show_in_nav_menus' => true,
379
+				'query_var' => true,
380
+				'exclude_from_search' => true,
381
+				'rewrite' => array(
382
+					'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) ,
383
+					'with_front' =>  false,
384
+					'feeds' => false,
385
+					'pages' => true
386
+				),
387
+				'map_meta_cap' => true,
388
+				'capability_type' => 'question',
389
+				'has_archive' => true,
390
+				'hierarchical' => false,
391
+				'menu_position' => 50,
392
+				'supports' => array( 'title', 'editor', 'comments' ),
393 393
 			);
394 394
 
395
-            /**
396
-             * Filter the arguments passed in when registering the Sensei sensei_message post type.
397
-             *
398
-             * @since 1.9.0
399
-             * @param array $args
400
-             */
395
+			/**
396
+			 * Filter the arguments passed in when registering the Sensei sensei_message post type.
397
+			 *
398
+			 * @since 1.9.0
399
+			 * @param array $args
400
+			 */
401 401
 			register_post_type( 'sensei_message', apply_filters('sensei_register_post_type_sensei_message',  $args ) );
402 402
 		}
403 403
 	} // End setup_sensei_message_post_type()
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
 			'show_ui' => true,
431 431
 			'query_var' => true,
432 432
 			'show_in_nav_menus' => true,
433
-            'capabilities' => array(
434
-                'manage_terms' => 'manage_categories',
435
-                'edit_terms'   => 'edit_courses',
436
-                'delete_terms' => 'manage_categories',
437
-                'assign_terms' => 'edit_courses',),
433
+			'capabilities' => array(
434
+				'manage_terms' => 'manage_categories',
435
+				'edit_terms'   => 'edit_courses',
436
+				'delete_terms' => 'manage_categories',
437
+				'assign_terms' => 'edit_courses',),
438 438
 			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_course_category_slug', _x( 'course-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
439 439
 		);
440 440
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 			'show_ui' => true, /* TO DO - future releases */
472 472
 			'query_var' => true,
473 473
 			'show_in_nav_menus' => false,
474
-            'public' => false,
474
+			'public' => false,
475 475
 			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_quiz_type_slug', _x( 'quiz-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
476 476
 		);
477 477
 
@@ -544,11 +544,11 @@  discard block
 block discarded – undo
544 544
 			'query_var' => false,
545 545
 			'show_in_nav_menus' => false,
546 546
 			'show_admin_column' => true,
547
-            'capabilities' => array(
548
-                'manage_terms' => 'manage_categories',
549
-                'edit_terms'   => 'edit_questions',
550
-                'delete_terms' => 'manage_categories',
551
-                'assign_terms' => 'edit_questions',),
547
+			'capabilities' => array(
548
+				'manage_terms' => 'manage_categories',
549
+				'edit_terms'   => 'edit_questions',
550
+				'delete_terms' => 'manage_categories',
551
+				'assign_terms' => 'edit_questions',),
552 552
 			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_category_slug', _x( 'question-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
553 553
 		);
554 554
 
@@ -582,11 +582,11 @@  discard block
 block discarded – undo
582 582
 			'show_ui' => true,
583 583
 			'query_var' => true,
584 584
 			'show_in_nav_menus' => true,
585
-            'capabilities' => array(
586
-                'manage_terms' => 'manage_categories',
587
-                'edit_terms'   => 'edit_lessons',
588
-                'delete_terms' => 'manage_categories',
589
-                'assign_terms' => 'edit_lessons',),
585
+			'capabilities' => array(
586
+				'manage_terms' => 'manage_categories',
587
+				'edit_terms'   => 'edit_lessons',
588
+				'delete_terms' => 'manage_categories',
589
+				'assign_terms' => 'edit_lessons',),
590 590
 			'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_lesson_tag_slug', _x( 'lesson-tag', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) )
591 591
 		);
592 592
 
@@ -620,19 +620,19 @@  discard block
 block discarded – undo
620 620
 	 */
621 621
 	private function create_post_type_labels ( $singular, $plural, $menu ) {
622 622
 		$labels = array(
623
-		    'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ),
624
-		    'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ),
625
-		    'add_new' => __( 'Add New', 'woothemes-sensei' ),
626
-		    'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ),
627
-		    'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ),
628
-		    'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ),
629
-		    'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ),
630
-		    'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ),
631
-		    'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ),
632
-		    'not_found' =>  sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
633
-		    'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
634
-		    'parent_item_colon' => '',
635
-		    'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu )
623
+			'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ),
624
+			'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ),
625
+			'add_new' => __( 'Add New', 'woothemes-sensei' ),
626
+			'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ),
627
+			'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ),
628
+			'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ),
629
+			'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ),
630
+			'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ),
631
+			'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ),
632
+			'not_found' =>  sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
633
+			'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ),
634
+			'parent_item_colon' => '',
635
+			'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu )
636 636
 		  );
637 637
 
638 638
 		return $labels;
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	 * Assigns the defaults for each user role capabilities.
706 706
 	 *
707 707
 	 * @since  1.1.0
708
-     *
708
+	 *
709 709
 	 * @param array $post_types
710 710
 	 * @return void
711 711
 	 */
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 	 * Adds a 'Edit Quiz' link to the admin bar when viewing a Quiz linked to a corresponding Lesson
774 774
 	 * 
775 775
 	 * @since  1.7.0
776
-     * @param WP_Admin_Bar $bar
776
+	 * @param WP_Admin_Bar $bar
777 777
 	 * @return void
778 778
 	 */
779 779
 	public function quiz_admin_bar_menu( $bar ) {
Please login to merge, or discard this patch.