Make WordPress Core

Changeset 3558


Ignore:
Timestamp:
02/20/2006 05:13:06 PM (19 years ago)
Author:
ryan
Message:

Fix post/page slug out. Props donncha. fixes #2472

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r3548 r3558  
    676676        $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
    677677
    678     $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path'");
     678    $pages = $wpdb->get_results("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = '$leaf_path' AND post_type='page'");
    679679
    680680    if ( empty($pages) )
     
    685685        $curpage = $page;
    686686        while ($curpage->post_parent != 0) {
    687             $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent'");
     687            $curpage = $wpdb->get_row("SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = '$curpage->post_parent' and post_type='page'");
    688688            $path = '/' . $curpage->post_name . $path;
    689689        }
  • trunk/wp-includes/template-functions-post.php

    r3517 r3558  
    259259        echo "<ul class='post-meta'>\n";
    260260        foreach ( $keys as $key ) {
     261            $keyt = trim($key);
     262            if ( '_' == $keyt{0} )
     263                continue;
    261264            $values = array_map('trim', get_post_custom_values($key));
    262265            $value = implode($values,', ');
Note: See TracChangeset for help on using the changeset viewer.