pre_comment_author_email
Filter HookDescription
Filters the comment author's IP address before it is set.Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2187 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$comment_author_ip
|
The comment author's IP address. |
Usage Examples
Basic Usage
<?php
// Hook into pre_comment_author_email
add_filter('pre_comment_author_email', 'my_custom_filter', 10, 1);
function my_custom_filter($comment_author_ip) {
// Your custom filtering logic here
return $comment_author_ip;
}
Source Code Context
wp-includes/comment.php:2187
- How this hook is used in WordPress core
<?php
2182 */
2183 $commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );
2184 /** This filter is documented in wp-includes/comment.php */
2185 $commentdata['comment_author_url'] = apply_filters( 'pre_comment_author_url', $commentdata['comment_author_url'] );
2186 /** This filter is documented in wp-includes/comment.php */
2187 $commentdata['comment_author_email'] = apply_filters( 'pre_comment_author_email', $commentdata['comment_author_email'] );
2188
2189 $commentdata['filtered'] = true;
2190
2191 return $commentdata;
2192 }
PHP Documentation
<?php
/**
* Filters the comment author's IP address before it is set.
*
* @since 1.5.0
*
* @param string $comment_author_ip The comment author's IP address.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.