I need to force plugin to rewrite text in all new posts and to save these changes in database. Something like
function rewriter($post) {
$post .= " - some text added";
$post = str_replace('word','replacement',$post);
return $post;
}
I've tried hooks like
add_action('the_content', 'rewriter', 0);
add_action( "save_post", "rewriter",100,1);
didn't work for me. What hooks to use in this case?
(add_filter is not the case because rewriter() actually has tremendous amount of code + connections to remote servers)