From ac434b5c398cf8fe6091175ba570b707f3b11ae1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 24 May 2014 06:48:16 +0000 Subject: [PATCH] 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 --- wp-includes/post-template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index bec04075e6..50ad3eb4a7 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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 ); } }