protected_title_format and private_title_format. Props anderswc. fixes #8918

git-svn-id: http://svn.automattic.com/wordpress/trunk@11111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-28 17:36:10 +00:00
parent 9ef2afc85b
commit e7f2b40dd7

View File

@ -109,10 +109,13 @@ function get_the_title( $id = 0 ) {
$title = $post->post_title; $title = $post->post_title;
if ( !is_admin() ) { if ( !is_admin() ) {
if ( !empty($post->post_password) ) if ( !empty($post->post_password) ) {
$title = sprintf(__('Protected: %s'), $title); $protected_title_format = apply_filters('protected_title_format', __('Protected: %s'));
else if ( isset($post->post_status) && 'private' == $post->post_status ) $title = sprintf($protected_title_format, $title);
$title = sprintf(__('Private: %s'), $title); } else if ( isset($post->post_status) && 'private' == $post->post_status ) {
$private_title_format = apply_filters('private_title_format', __('Private: %s'));
$title = sprintf($private_title_format, $title);
}
} }
return apply_filters( 'the_title', $title ); return apply_filters( 'the_title', $title );
} }