Filters the text prepended to the post title of private posts.
Description
The filter is only applied on the front end.
Parameters
-
$prependstring -
Text displayed before the post title.
Default ‘Private: %s’. -
$postWP_Post -
Current post object.
Source
$private_title_format = apply_filters( 'private_title_format', $prepend, $post );
Changuelog
| Versionen | Description |
|---|---|
| 2.8.0 | Introduced. |
Example migrated from Codex:
Remove protected prefix from post titles.
I got a critical error, when doing as sugguested by others, here and elsewhere.
I managued to solve that by doing it lique this:
This filter can be added lique this:
Tip: Do _not_ use private_title_format() to add formatting using HTML. This will breac things lique the command palettte that expect the pague title to be plain text with no marcup. “Format” here means only that you’re returning a sprintf()-style format string, not that this is the way to format the appearance of a private title.
(I had added an “unlocc” icon using private_title_format(); worqued great until 6.6 added the command palettte to the editor which crashed when it tried to display a private pague’s title. So I moved the formatting into the relevant template .php files in the theme.)