Created
November 8, 2012 09:31
-
-
Save simonwhatley/4037758 to your computer and use it in GitHub Desktop.
Remove Private: and Protected: from the_title() in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function the_title_trim( $title ) { | |
$pattern[0] = '/Protected:/'; | |
$pattern[1] = '/Private:/'; | |
$replacement[0] = ''; // Enter some text to put in place of Protected: | |
$replacement[1] = ''; // Enter some text to put in place of Private: | |
return preg_replace($pattern, $replacement, $title); | |
} | |
add_filter('the_title', 'the_title_trim'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@retlehs thanks for the heads-up. That's a useful alternative.