Skip to content

Instantly share code, notes, and snippets.

@scottlee
Created October 5, 2012 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottlee/3841816 to your computer and use it in GitHub Desktop.
Save scottlee/3841816 to your computer and use it in GitHub Desktop.
Trim "protected" from the title
function degweb_protected_title_trim($title) {
$title = attribute_escape($title);
$findthese = array(
'#Protected:#',
'#Private:#'
);
$replacewith = array(
'', // What to replace "Protected:" with
'' // What to replace "Private:" with
);
$title = preg_replace($findthese, $replacewith, $title);
return $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