Make WordPress Core


Ignore:
Timestamp:
12/19/2004 12:10:10 AM (20 years ago)
Author:
saxmatt
Message:

First pass at dashboard. Hat tip: Jesuit.

File:
1 edited

Legend:

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

    r1966 r1976  
    4747}
    4848
    49 function get_the_title() {
    50     global $post;
    51     $output = $post->post_title;
    52     if (!empty($post->post_password)) { // if there's a password
    53         $output = 'Protected: ' . $output;
    54     }
    55     return $output;
     49function get_the_title($id = 0) {
     50    global $post, $wpdb;
     51    $title = $post->post_title;
     52    if ( 0 != $id )
     53        $title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $id");
     54
     55    if ( !empty($post->post_password) ) { // if there's a password
     56        $title = 'Protected: ' . $title;
     57    }
     58    return $title;
    5659}
    5760
Note: See TracChangeset for help on using the changeset viewer.