From 5177b317024c0f4db98c47e5b89853e1c4ccc056 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 20 Feb 2006 17:13:06 +0000 Subject: [PATCH] Fix post/page slug out. Props donncha. fixes #2472 git-svn-id: https://develop.svn.wordpress.org/trunk@3558 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 4 ++-- wp-includes/template-functions-post.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 9e43922583..85fcacf70a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -675,7 +675,7 @@ function get_page_by_path($page_path) { foreach($page_paths as $pathdir) $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir); - $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path'"); + $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'"); if ( empty($pages) ) return 0; @@ -684,7 +684,7 @@ function get_page_by_path($page_path) { $path = '/' . $leaf_path; $curpage = $page; while ($curpage->post_parent != 0) { - $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent'"); + $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent' and post_type='page'"); $path = '/' . $curpage->post_name . $path; } diff --git a/wp-includes/template-functions-post.php b/wp-includes/template-functions-post.php index 07cfd1416a..c76e3bd1e0 100644 --- a/wp-includes/template-functions-post.php +++ b/wp-includes/template-functions-post.php @@ -258,6 +258,9 @@ function the_meta() { if ( $keys = get_post_custom_keys() ) { echo "