WordPress.org

Make WordPress Core

Ticket #16041: 16041.001.diff

File 16041.001.diff, 941 bytes (added by aaroncampbell, 11 years ago)
  • wp-includes/general-template.php

     
    620620 * Display or retrieve page title for post.
    621621 *
    622622 * This is optimized for single.php template file for displaying the post title.
    623  * Only useful for posts, does not support pages for example.
    624623 *
    625624 * It does not support placing the separator after the title, but by leaving the
    626625 * prefix parameter empty, you can set the title separator manually. The prefix
     
    634633 * @return string|null Title when retrieving, null when displaying or failure.
    635634 */
    636635function single_post_title($prefix = '', $display = true) {
    637         global $post;
     636        $_post = get_queried_object();
    638637
    639         if ( ! $post )
    640                 $_post = get_queried_object();
    641         else
    642                 $_post = $post;
    643 
    644638        if ( !isset($_post->post_title) )
    645639                return;
    646640