Filter to manipulate the_title AND the_content at the same time
-
Hi there community,
I want to create a little plugin to show specific posts only between 10pm and 6am as some kind of youth protection.
I managed to edit the title of the posts with:
function hidefsk16 ($title) { $fsk = substr($title,0,7); if ($fsk == "[FSK16]") { $title = substr($title,8); return "FSK16 - ab 22 Uhr freigeschaltet ".$title; } return $title; } add_filter('the_title','hidefsk16');
but I also want to manipulate the content of the post to be something like “No text here. Come back later” instead of the original text.
How can I do that with one filter? Is it possible to do that with only one filter?
Thanks!
PS: Maybe there already is a plugin which does exact this. Show me ??
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Filter to manipulate the_title AND the_content at the same time’ is closed to new replies.