Viewing 3 replies - 1 through 3 (of 3 total)
  • add the following to your functions.php file in your theme directory.

    remove_filter('comment_text','make_clickable',9);
    add_filter('comment_text' , 'ft_make_clickable',9);
    function ft_make_clickable($ret){
    	//disables auto generation of links in comments for 'www.website.com' but leaves 'https://www.website.com'
    	//email glenn a_t fullthrottledevelopment d_o_t com for further assistance.
    	$ret = ' ' . $ret;
    	// in testing, using arrays here was found to be faster
    	$ret = preg_replace_callback('#([\s>])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_url_clickable_cb', $ret);
    	$ret = preg_replace_callback('#([\s>])((ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is', '_make_web_ftp_clickable_cb', $ret);
    	$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
    	// this one is not in an array because we need it to run last, for cleanup of accidental links within links
    	$ret = preg_replace("#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i", "$1$3</a>", $ret);
    	$ret = trim($ret);
    
    	return $ret;
    }
    Thread Starter Droiddoll

    (@droiddoll)

    hey thanks, you’ve solved my problem with the passwords that users published
    u’re a god thousand thanks!!!!!!!!!!!!!!!!!!!!

    Glad it worked.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there any way to disable this?’ is closed to new replies.