set_comment_cookies

set_comment_cookies

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('set_comment_cookies') is found 1 times:

  • /wp-comments-post.php line 55
     * @param WP_Comment $comment         Comment object.
     * @param WP_User    $user            Comment author's user object. The user may not exist.
     * @param bool       $cookies_consent Comment author's consent to store cookies.
     */
    do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
    
    $location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID;
    
    // If user didn't consent to cookies, add specific query arguments to display the awaiting moderation message.
    if ( ! $cookies_consent && 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
    	$location = add_query_arg(