WordPress.org

Make WordPress Core

Ticket #8918: post-template.diff

File post-template.diff, 932 bytes (added by anderswc, 6 years ago)
  • post-template.php

     
    109109        $title = $post->post_title; 
    110110 
    111111        if ( !is_admin() ) { 
    112                 if ( !empty($post->post_password) ) 
    113                         $title = sprintf(__('Protected: %s'), $title); 
    114                 else if ( isset($post->post_status) && 'private' == $post->post_status ) 
    115                         $title = sprintf(__('Private: %s'), $title); 
     112                if ( !empty($post->post_password) ) { 
     113                        $protected_title_format = apply_filters('protected_title_format', __('Protected: %s')); 
     114                        $title = sprintf($protected_title_format, $title); 
     115                } else if ( isset($post->post_status) && 'private' == $post->post_status ) { 
     116                        $private_title_format = apply_filters('private_title_format', __('Private: %s')); 
     117                        $title = sprintf($private_title_format, $title); 
     118                } 
    116119        } 
    117120        return apply_filters( 'the_title', $title ); 
    118121}