Created
August 30, 2012 06:36
-
-
Save thefuxia/3523355 to your computer and use it in GitHub Desktop.
T5 Change Comment Notification IP Lookup URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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