Fix post/page slug out. Props donncha. fixes #2472
git-svn-id: http://svn.automattic.com/wordpress/trunk@3558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2fc8c248b3
commit
605d4a617a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -258,6 +258,9 @@ function the_meta() {
|
|||
if ( $keys = get_post_custom_keys() ) {
|
||||
echo "<ul class='post-meta'>\n";
|
||||
foreach ( $keys as $key ) {
|
||||
$keyt = trim($key);
|
||||
if ( '_' == $keyt{0} )
|
||||
continue;
|
||||
$values = array_map('trim', get_post_custom_values($key));
|
||||
$value = implode($values,', ');
|
||||
echo "<li><span class='post-meta-key'>$key:</span> $value</li>\n";
|
||||
|
|
Loading…
Reference in New Issue