Make WordPress Core

Changeset 16818


Ignore:
Timestamp:
12/08/2010 09:10:38 PM (14 years ago)
Author:
markjaquith
Message:

Do not do slug logging/redirects for hierarchical post types. see #15140

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r16787 r16818  
    40254025        return;
    40264026
    4027     // we're only concerned with published objects
    4028     if ( $post->post_status != 'publish' )
     4027    // we're only concerned with published, non-hierarchical objects
     4028    $ptype_obj = get_post_type_object( $post->post_type );
     4029    if ( $post->post_status != 'publish' || !$ptype_obj || $ptype_obj->hierarchical )
    40294030        return;
    40304031
  • trunk/wp-includes/query.php

    r16792 r16818  
    32323232            $post_type = 'post';
    32333233
     3234        // Do not attempt redirect for hierarchical post types
     3235        $ptype_obj = get_post_type_object( $post_type );
     3236        if ( !$ptype_obj || $ptype_obj->hierarchical )
     3237            return;
     3238
    32343239        $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']);
    32353240
Note: See TracChangeset for help on using the changeset viewer.