Fix to have post title where post_name is specified but post ID is not.

git-svn-id: http://svn.automattic.com/wordpress/trunk@610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-12-13 17:53:42 +00:00
parent e1e8c6dbf7
commit 09092a3d3e
1 changed files with 5 additions and 2 deletions

View File

@ -73,8 +73,11 @@ function get_bloginfo($show='') {
}
function single_post_title($prefix = '', $display = true) {
global $p;
if (intval($p)) {
global $p, $name, $wpdb, $tableposts;
if (intval($p) || '' != $name) {
if (!$p) {
$p = $wpdb->get_var("SELECT ID FROM $tableposts WHERE post_name = '$name'");
}
$post_data = get_postdata($p);
$title = $post_data['Title'];
$title = apply_filters('single_post_title', $title);