-m Remove protected and private from post titles that are.
authorLaury GvR <laury@gaslightmedia.com>
Thu, 8 Nov 2018 17:22:07 +0000 (12:22 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 8 Nov 2018 17:22:07 +0000 (12:22 -0500)
functions.php

index 666fe20..6ab9d54 100644 (file)
@@ -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');
+
 ?>