Code Duplication    Length = 9-10 lines in 2 locations

core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_critical_page_shortcode_tracking.dmsstage.php 1 location

@@ 99-107 (lines=9) @@
96
     *  @access 	private
97
     *  @return 	string
98
     */
99
    private function _get_page_for_posts() {
100
        $page_for_posts = get_option( 'page_for_posts' );
101
        if ( ! $page_for_posts ) {
102
            return 'posts';
103
        }
104
        global $wpdb;
105
        $SQL = 'SELECT post_name from ' . $wpdb->posts . ' WHERE post_type="posts" OR post_type="page" AND post_status="publish" AND ID=%s';
106
        return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ));
107
    }
108
109
110

core/EE_Config.core.php 1 location

@@ 910-919 (lines=10) @@
907
	 * @access    public
908
	 * @return    string
909
	 */
910
	public static function get_page_for_posts() {
911
		$page_for_posts = get_option( 'page_for_posts' );
912
		if ( ! $page_for_posts ) {
913
			return 'posts';
914
		}
915
		/** @type WPDB $wpdb */
916
		global $wpdb;
917
		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
918
		return $wpdb->get_var( $wpdb->prepare( $SQL, $page_for_posts ) );
919
	}
920
921
922