@charset "UTF-8";
/*
    Template: swell
    Theme Name: SWELL CHILD
    Theme URI: https://swell-theme.com/
    Description: SWELLの子テーマ
    Version: 1.0.0
    Author: LOOS WEB STUDIO
    Author URI: https://loos-web-studio.com/

    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/

function convert_links_in_comments($comment_text) {
    $comment_text = preg_replace_callback('#https?://[^\s<"]+#i', function($matches) {
        $url = $matches[0];
        $url = str_replace(['http', '.', ':'], ['hxxp', '[.]', '[:]'], $url);
        return $url;
    }, $comment_text);
    return $comment_text;
}
add_filter('get_comment_text', 'convert_links_in_comments', 9);