Заставляем все ссылки открываться в новом окне для WordPress
1 2 3 4 5 6 7 8 9 |
function autoblank($text) { $return = str_replace('href=', 'target="_blank" href=', $text); $return = str_replace('target="_blank" href="/', 'href="/', $return); $return = str_replace('target="_blank" href="#', 'href="#', $return); $return = str_replace(' target = "_blank">', '>', $return); return $return; } add_filter('the_content', 'autoblank'); add_filter('comment_text', 'autoblank'); |