WordPress.org

Make WordPress Core

Ticket #4328: 4328.patch

File 4328.patch, 1.2 KB (added by SergeyBiryukov, 10 years ago)
  • wp-includes/post.php

     
    40234023        if ( $post->post_name == $post_before->post_name )
    40244024                return;
    40254025
    4026         // we're only concerned with published, non-hierarchical objects
    4027         if ( $post->post_status != 'publish' || is_post_type_hierarchical( $post->post_type ) )
     4026        // we're only concerned with published objects
     4027        if ( $post->post_status != 'publish' )
    40284028                return;
    40294029
    40304030        $old_slugs = (array) get_post_meta($post_id, '_wp_old_slug');
  • wp-includes/query.php

     
    34473447                else
    34483448                        $post_type = 'post';
    34493449
    3450                 // Do not attempt redirect for hierarchical post types
    3451                 if ( is_post_type_hierarchical( $post_type ) )
    3452                         return;
    3453 
    34543450                $query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, $wp_query->query_vars['name']);
    34553451
    34563452                // if year, monthnum, or day have been specified, make our query more precise