Code Duplication    Length = 9-9 lines in 2 locations

includes/class-sensei-course.php 1 location

@@ 395-403 (lines=9) @@
392
			return $post_id;
393
		} // End If Statement
394
395
		if ( 'page' == $_POST['post_type'] ) {
396
			if ( ! current_user_can( 'edit_page', $post_id ) ) {
397
				return $post_id;
398
			} // End If Statement
399
		} else {
400
			if ( ! current_user_can( 'edit_post', $post_id ) ) {
401
				return $post_id;
402
			} // End If Statement
403
		} // End If Statement
404
405
		// Save the post meta data fields
406
		if ( isset($this->meta_fields) && is_array($this->meta_fields) ) {

includes/class-sensei-lesson.php 1 location

@@ 259-267 (lines=9) @@
256
			return $post_id;
257
		} // End If Statement
258
		// Check if the current post type is a page
259
		if ( 'page' == $_POST[ 'post_type' ] ) {
260
			if ( ! current_user_can( 'edit_page', $post_id ) ) {
261
				return $post_id;
262
			} // End If Statement
263
		} else {
264
			if ( ! current_user_can( 'edit_post', $post_id ) ) {
265
				return $post_id;
266
			} // End If Statement
267
		} // End If Statement
268
		// Save the post meta data fields
269
		if ( isset($this->meta_fields) && is_array($this->meta_fields) ) {
270
			foreach ( $this->meta_fields as $meta_key ) {