[wp-cvs] wordpress/wp-includes template-functions-post.php, 1.41, 1.42

Ryan Boren rboren at users.sourceforge.net
Mon Jan 17 20:16:42 GMT 2005


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1309

Modified Files:
	template-functions-post.php 
Log Message:
Fix $id arg processing for get_the_title().  Also, mark "Protected:" for translation.  Bug 706.  Props: morganiq

Index: template-functions-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-post.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** template-functions-post.php	15 Jan 2005 15:51:31 -0000	1.41
--- template-functions-post.php	17 Jan 2005 20:16:22 -0000	1.42
***************
*** 42,52 ****
  function get_the_title($id = 0) {
  	global $post, $wpdb;
! 	$title = $post->post_title;
! 
! 	if ( 0 != $id )
! 		$title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $id");
! 
! 	if ( !empty($post->post_password) ) { // if there's a password
! 		$title = 'Protected: ' . $title;
  	}
  	return $title;
--- 42,56 ----
  function get_the_title($id = 0) {
  	global $post, $wpdb;
! 	
! 	if ( 0 != $id ) {
! 		$id_post = $wpdb->get_row("SELECT post_title, post_password FROM $wpdb->posts WHERE ID = $id");
! 		$title = $id_post->post_title;
! 		if (!empty($id_post->post_password))
! 			$title = sprintf(__('Protected: %s'), $title);
! 	}
! 	else {
! 		$title = $post->post_title;
! 		if (!empty($post->post_password))
! 			$title = sprintf(__('Protected: %s'), $title);
  	}
  	return $title;
***************
*** 58,62 ****
  
  	if ( 0 != $id )
! 		$title = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE ID = $id");
  	$guid = apply_filters('get_the_guid', $guid);
  	return $guid;
--- 62,66 ----
  
  	if ( 0 != $id )
! 		$guid = $wpdb->get_var("SELECT guid FROM $wpdb->posts WHERE ID = $id");
  	$guid = apply_filters('get_the_guid', $guid);
  	return $guid;



More information about the cvs mailing list