Code Duplication    Length = 8-9 lines in 2 locations

includes/class-sensei-frontend.php 2 locations

@@ 471-479 (lines=9) @@
468
		foreach( $sorted_menu_items as $k=>$item ) {
469
470
			// Remove the My Messages link for logged out users or if Private Messages are disabled
471
			if( ! get_post_type_archive_link( 'sensei_message' )
472
                && '#senseimymessages' == $item->url ) {
473
474
				if ( !is_user_logged_in() || ( isset( Sensei()->settings->settings['messages_disable'] ) && Sensei()->settings->settings['messages_disable'] ) ) {
475
476
					unset( $sorted_menu_items[$k] );
477
478
				}
479
			}
480
			// Remove the My Profile link for logged out users.
481
			if( Sensei()->learner_profiles->get_permalink() == $item->url ) {
482
@@ 481-488 (lines=8) @@
478
				}
479
			}
480
			// Remove the My Profile link for logged out users.
481
			if( Sensei()->learner_profiles->get_permalink() == $item->url ) {
482
483
				if ( !is_user_logged_in() || ! ( isset( Sensei()->settings->settings[ 'learner_profile_enable' ] ) && Sensei()->settings->settings[ 'learner_profile_enable' ] ) ) {
484
485
					unset( $sorted_menu_items[$k] );
486
487
				}
488
			}
489
		}
490
		return $sorted_menu_items;
491
	} // End sensei_wp_nav_menu_objects