ControlledChaos
7/22/2016 - 8:00 PM

Filters the the text before titles of private and password-protected posts.

Filters the the text before titles of private and password-protected posts.

<?php

function ccd_title_trim( $title ) {
	$title = attribute_escape( $title );
	$findthese = array(
		'#Protected:#',
		'#Private:#'
	);
	$replacewith = array(
		'', // Text to replace "Protected:"
		'' // Text to replace "Private:"
	);
	$title = preg_replace( $findthese, $replacewith, $title );
	return $title;
}
add_filter( 'the_title', 'ccd_title_trim' );

?>

New Private/Protected Titles

WordPress Snippet