mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 09:07:59 +01:00
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:
parent
9ef2afc85b
commit
e7f2b40dd7
@ -109,10 +109,13 @@ function get_the_title( $id = 0 ) {
|
||||
$title = $post->post_title;
|
||||
|
||||
if ( !is_admin() ) {
|
||||
if ( !empty($post->post_password) )
|
||||
$title = sprintf(__('Protected: %s'), $title);
|
||||
else if ( isset($post->post_status) && 'private' == $post->post_status )
|
||||
$title = sprintf(__('Private: %s'), $title);
|
||||
if ( !empty($post->post_password) ) {
|
||||
$protected_title_format = apply_filters('protected_title_format', __('Protected: %s'));
|
||||
$title = sprintf($protected_title_format, $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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user