Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
T5 Change Comment Notification IP Lookup URL
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Change Comment Notification IP Lookup URL
* Description: Replaces the link for the IP lookup.
* Plugin URI: http://toscho.de/?p=2216
* Version: 2012.08.30
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
add_filter( 'comment_notification_text', 't5_comment_notification_ip_url' );
add_filter( 'comment_moderation_text', 't5_comment_notification_ip_url' );
/**
* Replace URL to IP address lookup.
*
* @param string $text
* @return string
*/
function t5_comment_notification_ip_url( $text )
{
return str_replace(
'http://whois.arin.net/rest/ip/',
'http://ip.toscho.de/?ip=',
$text
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment