Pass $post to 'protected_title_format' and 'private_title_format' filters.
props johnjamesjacoby, DrewAPicture. fixes #23724. Built from https://develop.svn.wordpress.org/trunk@28571 git-svn-id: http://core.svn.wordpress.org/trunk@28396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3e0521c2cf
commit
ac434b5c39
|
@ -123,10 +123,11 @@ function get_the_title( $post = 0 ) {
|
|||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param string $prepend Text displayed before the post title.
|
||||
* Default 'Protected: %s'.
|
||||
* @param string $prepend Text displayed before the post title.
|
||||
* Default 'Protected: %s'.
|
||||
* @param WP_Post $post Current post object.
|
||||
*/
|
||||
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ) );
|
||||
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
|
||||
$title = sprintf( $protected_title_format, $title );
|
||||
} else if ( isset( $post->post_status ) && 'private' == $post->post_status ) {
|
||||
|
||||
|
@ -137,10 +138,11 @@ function get_the_title( $post = 0 ) {
|
|||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param string $prepend Text displayed before the post title.
|
||||
* Default 'Private: %s'.
|
||||
* @param string $prepend Text displayed before the post title.
|
||||
* Default 'Private: %s'.
|
||||
* @param WP_Post $post Current post object.
|
||||
*/
|
||||
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ) );
|
||||
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ), $post );
|
||||
$title = sprintf( $private_title_format, $title );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue