wp_get_current_commenter
Filter HookDescription
Filters the current commenter's name, email, and URL. }Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1970 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$comment_author_data
|
{ An array of current commenter variables. |
Usage Examples
Basic Usage
<?php
// Hook into wp_get_current_commenter
add_filter('wp_get_current_commenter', 'my_custom_filter', 10, 1);
function my_custom_filter($comment_author_data) {
// Your custom filtering logic here
return $comment_author_data;
}
Source Code Context
wp-includes/comment.php:1970
- How this hook is used in WordPress core
<?php
1965 * @type string $comment_author The name of the current commenter, or an empty string.
1966 * @type string $comment_author_email The email address of the current commenter, or an empty string.
1967 * @type string $comment_author_url The URL address of the current commenter, or an empty string.
1968 * }
1969 */
1970 return apply_filters( 'wp_get_current_commenter', compact( 'comment_author', 'comment_author_email', 'comment_author_url' ) );
1971 }
1972
1973 /**
1974 * Gets unapproved comment author's email.
1975 *
PHP Documentation
<?php
/**
* Filters the current commenter's name, email, and URL.
*
* @since 3.1.0
*
* @param array $comment_author_data {
* An array of current commenter variables.
*
* @type string $comment_author The name of the current commenter, or an empty string.
* @type string $comment_author_email The email address of the current commenter, or an empty string.
* @type string $comment_author_url The URL address of the current commenter, or an empty string.
* }
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.