WordPress.org

Make WordPress Core

Ticket #24763: get_page_by_path_request.patch

File get_page_by_path_request.patch, 821 bytes (added by zbtirrell, 9 months ago)

patch file for the suggested change

  • wp-includes/post.php

     
    34233423        $in_string = "'". implode( "','", $parts ) . "'"; 
    34243424        $post_type_sql = $post_type; 
    34253425        $wpdb->escape_by_ref( $post_type_sql ); 
    3426         $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')", OBJECT_K ); 
     3426        $pages = $wpdb->get_results( apply_filters( 'get_page_by_path_request', "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')" ), OBJECT_K ); 
    34273427 
    34283428        $revparts = array_reverse( $parts ); 
    34293429