Advertisement
Guest User

allow-links.php

a guest
May 13th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function keep_my_links($text) {
  2. global $post;
  3. if ( '' == $text ) {
  4. $text = get_the_content('');
  5. $text = apply_filters('the_content', $text);
  6. $text = str_replace('\]\]\>', ']]>', $text);
  7. $text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
  8. $text = strip_tags($text, '<a>');
  9. }
  10. return $text;
  11. }
  12. remove_filter('get_the_excerpt', 'wp_trim_excerpt');
  13. add_filter('get_the_excerpt', 'keep_my_links');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement