Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created August 30, 2012 06:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefuxia/3523355 to your computer and use it in GitHub Desktop.
Save thefuxia/3523355 to your computer and use it in GitHub Desktop.
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