Code Duplication    Length = 6-8 lines in 2 locations

includes/class-sensei-messages.php 1 location

@@ 411-418 (lines=8) @@
408
        }
409
410
        $settings = Sensei()->settings->get_settings();
411
        if( isset( $settings[ 'my_course_page' ] )
412
            && 0 < intval( $settings[ 'my_course_page' ] ) ){
413
414
            $my_courses_page_id = $settings[ 'my_course_page' ];
415
416
            $my_courses_url = get_permalink($my_courses_page_id);
417
418
        }
419
420
        if ( is_single() && is_singular( $this->post_type )
421
            || is_post_type_archive( $this->post_type ) ) {

includes/class-sensei-course.php 1 location

@@ 2800-2805 (lines=6) @@
2797
                    $wp_register_link = apply_filters('sensei_use_wp_register_link', false);
2798
2799
                    $settings = Sensei()->settings->get_settings();
2800
                    if( isset( $settings[ 'my_course_page' ] )
2801
                        && 0 < intval( $settings[ 'my_course_page' ] ) ){
2802
2803
                        $my_courses_page_id = $settings[ 'my_course_page' ];
2804
2805
                    }
2806
2807
                    // If a My Courses page was set in Settings, and 'sensei_use_wp_register_link'
2808
                    // is false, link to My Courses. If not, link to default WordPress registration page.