Ticket #17037: 17037.diff
| File 17037.diff, 1.5 KB (added by solarissmoke, 2 years ago) |
|---|
-
wp-includes/post-template.php
99 99 * @since 0.71 100 100 * 101 101 * @param int $id Optional. Post ID. 102 * @return string 102 * @return string|bool Title if the post exists, false if the supplied id is invalid 103 103 */ 104 104 function get_the_title( $id = 0 ) { 105 $post = &get_post($id); 105 $post = get_post( $id ); 106 107 if( ! $post ) 108 return false; 106 109 107 $title = isset($post->post_title) ? $post->post_title : ''; 108 $id = isset($post->ID) ? $post->ID : (int) $id; 110 $title = $post->post_title; 109 111 110 if ( !is_admin() ) { 111 if ( !empty($post->post_password) ) { 112 $protected_title_format = apply_filters('protected_title_format', __('Protected: %s')); 113 $title = sprintf($protected_title_format, $title); 114 } else if ( isset($post->post_status) && 'private' == $post->post_status ) { 115 $private_title_format = apply_filters('private_title_format', __('Private: %s')); 116 $title = sprintf($private_title_format, $title); 117 } 112 if ( ! is_admin() ) { 113 if ( ! empty( $post->post_password ) ) 114 $title = sprintf( apply_filters( 'protected_title_format', __( 'Protected: %s' ) ), $title ); 115 else if ( isset( $post->post_status ) && 'private' == $post->post_status ) 116 $title = sprintf( apply_filters( 'private_title_format', __( 'Private: %s' ) ), $title ); 118 117 } 119 return apply_filters( 'the_title', $title, $ id);118 return apply_filters( 'the_title', $title, $post->ID ); 120 119 } 121 120 122 121 /**
