ControlledChaos of Controlled Chaos Design
8/9/2016 - 6:47 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