WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/protected title format

Description

protected_title_format is a filter applied to the post title when the post visibility is set to protected.

Parameters

$format
(string) (required) The string to output
Default: Protected: %s
$post
(WP_Post) (required) The related post
Default: None

Examples

/* Removing protected prefix from post titles */
function spi_remove_protected_protected_from_titles( $format, $post ) {
    return '%s';
}
add_filter( 'protected_title_format', 'spi_remove_protected_protected_from_titles' );

Source File

get_the_title() is located in wp-includes/post-template.php.

Related