Changeset 1976 for trunk/wp-includes/template-functions-post.php
- Timestamp:
- 12/19/2004 12:10:10 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/template-functions-post.php
r1966 r1976 47 47 } 48 48 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; 49 function 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; 56 59 } 57 60
Note: See TracChangeset
for help on using the changeset viewer.