Martin Evans
I'm based in Mid Wales and work mainly with Photoshop but use the full Adobe Creative Cloud suite. I am a keen photographer and enjoy photo manipulation and video effects through After Effects.

Remove Private/protected notices from posts

If you create and publish a private or protected post, the title will be amended with this status. Adding the below code to the functions.php file will remove the title alteration and make things look that little bit nicer.

function the_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');
Share

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.