From 068f055d73c83034c3e58aec01e60d20d122a859 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 8 Nov 2018 12:22:07 -0500 Subject: [PATCH] -m Remove protected and private from post titles that are. --- functions.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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'); + ?> -- 2.17.1