From: Laury GvR Date: Thu, 8 Nov 2018 17:22:07 +0000 (-0500) Subject: -m Remove protected and private from post titles that are. X-Git-Tag: v1.0.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=068f055d73c83034c3e58aec01e60d20d122a859;p=WP-Themes%2Flakesideclub.git -m Remove protected and private from post titles that are. --- diff --git a/functions.php b/functions.php index 666fe20..6ab9d54 100644 --- a/functions.php +++ b/functions.php @@ -274,4 +274,24 @@ if ( !function_exists( 'glm_get_simplemessageboard_option' ) ) { } } +// Removes 'protected' and 'private' from titles of posts that are. +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'); + ?>