Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#8918 closed enhancement (fixed)

Add Filters to format strings for Private and Protected Posts in get_the_title

Reported by: anderswc Owned by:
Milestone: 2.8 Priority: low
Severity: minor Version:
Component: Template Keywords: has-patch tested commit
Focuses: Cc:


When a page or post is protected or private, WordPress prefixes its title with either "Protected: " or "Private: " when get_the_title() is called.

This patch changes get_the_title to call filters for the format strings that add prefixes to protected and private posts. Plugins and themes can filter the format strings to remove or change the prefix.

Attachments (1)

post-template.diff (932 bytes) - added by anderswc 9 years ago.

Download all attachments as: .zip

Change History (4)

#1 @Denis-de-Bernardy
9 years ago

  • Keywords template the_title removed

won't be needed if #6284 gets checked in

#2 @Denis-de-Bernardy
9 years ago

  • Keywords tested commit added

Actually, nm that. :-)

But #9666 would certainly do the trick, in that it would allow to str_replace() the formatting afterwards.

#3 @Denis-de-Bernardy
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

see r11112

Note: See TracTickets for help on using tickets.