From 7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 4 Apr 2008 16:44:15 +0000 Subject: Merged with WordPress 2.5, unstable, only for testing git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1218 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/post-template.php | 125 +++++++++++++++++++++++++++++++++--------- 1 file changed, 99 insertions(+), 26 deletions(-) (limited to 'wp-includes/post-template.php') diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index a956dc4..47c1068 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -54,11 +54,13 @@ function get_the_title( $id = 0 ) { $post = &get_post($id); $title = $post->post_title; - if ( !empty($post->post_password) ) - $title = sprintf(__('Protected: %s'), $title); - else if ( 'private' == $post->post_status ) - $title = sprintf(__('Private: %s'), $title); + if ( !is_admin() ) { + if ( !empty($post->post_password) ) + $title = sprintf(__('Protected: %s'), $title); + else if ( isset($post->post_status) && 'private' == $post->post_status ) + $title = sprintf(__('Private: %s'), $title); + } return apply_filters( 'the_title', $title ); } @@ -81,13 +83,12 @@ function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { - global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages; - global $preview; - global $pagenow; + global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; + $output = ''; if ( !empty($post->post_password) ) { // if there's a password - if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie + if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie $output = get_the_password_form(); return $output; } @@ -137,12 +138,12 @@ function the_excerpt() { } -function get_the_excerpt($deprecated = true) { - global $id, $post; +function get_the_excerpt($deprecated = '') { + global $post; $output = ''; $output = $post->post_excerpt; if ( !empty($post->post_password) ) { // if there's a password - if ( $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie + if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie $output = __('There is no excerpt because this is a protected post.'); return $output; } @@ -167,7 +168,7 @@ function wp_link_pages($args = '') { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - global $post, $id, $page, $numpages, $multipage, $more, $pagenow; + global $post, $page, $numpages, $multipage, $more, $pagenow; if ( $more_file != '' ) $file = $more_file; else @@ -249,8 +250,6 @@ function post_custom( $key = '' ) { // this will probably change at some point... function the_meta() { - global $id; - if ( $keys = get_post_custom_keys() ) { echo "