X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..refs/tags/wordpress-2.5.1:/wp-includes/post-template.php diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index a956dc48..915101cb 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 "