mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Do not do slug logging/redirects for hierarchical post types. see #15140
git-svn-id: https://develop.svn.wordpress.org/trunk@16818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3231,6 +3231,11 @@ function wp_old_slug_redirect() {
|
||||
else
|
||||
$post_type = 'post';
|
||||
|
||||
// Do not attempt redirect for hierarchical post types
|
||||
$ptype_obj = get_post_type_object( $post_type );
|
||||
if ( !$ptype_obj || $ptype_obj->hierarchical )
|
||||
return;
|
||||
|
||||
$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']);
|
||||
|
||||
// if year, monthnum, or day have been specified, make our query more precise
|
||||
|
||||
Reference in New Issue
Block a user