comment_form_logged_in

Filters the 'logged in' message for the comment form for display.

Description

apply_filters( 'comment_form_logged_in', (string) $args_logged_in_as, (array) $commenter, (string) $user_identity ); 

Parameters (3)

0. $args_logged_in_as (string)
The logged-in-as HTML-formatted message.
1. $commenter (array)
An array containing the comment author's username, email, and URL.
2. $user_identity (string)
If the commenter is a registered user, the display name, blank otherwise.

Usage

To run the hook, copy the example below.
  1. $args_logged_in_as = apply_filters( 'comment_form_logged_in', $args_logged_in_as, $commenter, $user_identity ); 
  2.  
  3. if ( !empty( $args_logged_in_as ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the comment_form_logged_in callback 
  2. function filter_comment_form_logged_in( $args_logged_in_as, $commenter, $user_identity ) { 
  3. // make filter magic happen here... 
  4. return $args_logged_in_as
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'comment_form_logged_in', 'filter_comment_form_logged_in', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'comment_form_logged_in', 'filter_comment_form_logged_in', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/comment-template.php  
  1. echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity );