apply_filters( 'private_title_format', string $prepend, WP_Post $post )

Filters the text prepended to the post title of private posts.


Description

The filter is only applied on the front end.


Top ↑

Parameters

$prepend string
Text displayed before the post title.
Default 'Private: %s'.
$post WP_Post
Current post object.

Top ↑

Source

File: wp-includes/post-template.php. View all references

$private_title_format = apply_filters( 'private_title_format', $prepend, $post );


Top ↑

Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 2 content
    Contributed by henriko

    I got a critical error, when doing as suggested by others, here and elsewhere.

    I managed to solve that by doing it like this:

    function remove_private_prefix_from_titles( ...$_ ) {
      return "%s";
    }
    add_filter( 'private_title_format', 'wpdocs_remove_private_prefix_from_titles' );

You must log in before being able to contribute a note or feedback.