Gets current commenter’s name, email, and URL.
Description
Expects cookies content to already be sanitized. User of this function might wish to recheck the returned array for validity.
See also
- sanitize_comment_cookies(): Use to sanitize cookies
Source
*
* @param string $new_status The new comment status.
* @param string $old_status The old comment status.
*/
function _clear_modified_cache_on_transition_comment_status( $new_status, $old_status ) {
if ( 'approved' === $new_status || 'approved' === $old_status ) {
$data = array();
foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
$data[] = "lastcommentmodified:$timezone";
}
wp_cache_delete_multiple( $data, 'timeinfo' );
}
}
/**
* Gets current commenter's name, email, and URL.
*
* Expects cookies content to already be sanitized. User of this function might
* wish to recheck the returned array for validity.
*
* @see sanitize_comment_cookies() Use to sanitize cookies
*
* @since 2.0.4
*
* @return array {
* 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.
* }
*/
function wp_get_current_commenter() {
Changelog
Version | Description |
---|---|
2.0.4 | Introduced. |
Get current commenter detail
Output: