Make WordPress Core

Changeset 28571


Ignore:
Timestamp:
05/24/2014 06:47:55 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Pass $post to 'protected_title_format' and 'private_title_format' filters.

props johnjamesjacoby, DrewAPicture.
fixes #23724.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r28514 r28571  
    124124             * @since 2.8.0
    125125             *
    126              * @param string $prepend Text displayed before the post title.
    127              *                        Default 'Protected: %s'.
     126             * @param string  $prepend Text displayed before the post title.
     127             *                         Default 'Protected: %s'.
     128             * @param WP_Post $post    Current post object.
    128129             */
    129             $protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ) );
     130            $protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
    130131            $title = sprintf( $protected_title_format, $title );
    131132        } else if ( isset( $post->post_status ) && 'private' == $post->post_status ) {
     
    138139             * @since 2.8.0
    139140             *
    140              * @param string $prepend Text displayed before the post title.
    141              *                        Default 'Private: %s'.
     141             * @param string  $prepend Text displayed before the post title.
     142             *                         Default 'Private: %s'.
     143             * @param WP_Post $post    Current post object.
    142144             */
    143             $private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ) );
     145            $private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ), $post );
    144146            $title = sprintf( $private_title_format, $title );
    145147        }
Note: See TracChangeset for help on using the changeset viewer.