From 298c858c5b6b7fccefb211444a28342a02db96e6 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 8 Dec 2010 21:17:01 +0000 Subject: [PATCH] Use is_page_type_hierarchical(). props nacin. see #15140 git-svn-id: http://svn.automattic.com/wordpress/trunk@16819 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 3 +-- wp-includes/query.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index a7ba423336..41f3a9e4c0 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4025,8 +4025,7 @@ function wp_check_for_changed_slugs($post_id, $post, $post_before) { return; // we're only concerned with published, non-hierarchical objects - $ptype_obj = get_post_type_object( $post->post_type ); - if ( $post->post_status != 'publish' || !$ptype_obj || $ptype_obj->hierarchical ) + if ( $post->post_status != 'publish' || is_post_type_hierarchical( $post->post_type ) ) return; $old_slugs = (array) get_post_meta($post_id, '_wp_old_slug'); diff --git a/wp-includes/query.php b/wp-includes/query.php index 51f9bd1913..6486595507 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3232,8 +3232,7 @@ function wp_old_slug_redirect() { $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 ) + if ( is_post_type_hierarchical( $post_type ) ) 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']);