Guest User

Untitled

a guest
Oct 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. add_filter( 'the_content', 'filter_test'); // also tried the `wp` hook
  2. function filter_test($content){
  3. global $post;
  4. $post_slug = $post->post_name;
  5. if (get_post_type() == "post" && $post_slug != "allposts") {
  6. $content = preg_replace("/<strong>s+</strong>/",'',$content); // THIS LINE
  7. $content = preg_replace("/&nbsp;|^s*$/",'',$content);
  8. return $content;
  9. }
  10. return $content;
  11. }
Add Comment
Please, Sign In to add comment