Site logo

Archived topic

Removing "log out" option in comments

5 replies · Started by Jaakko Pöntinen on May 2, 2016

Viewing posts 1–6 of 6

Heya.

How to remove the logout link in the comment form?

- Jaakko Pöntinen

You could try this:

.comment-respond .logged-in-as {
    display: none;
}

Hey,

That sure works but also removes the "logged in as [username]". Could you, in a future version, add classes or other identifiers to the two a tags s so that you could fiddle with them easier :)

Thanks! I'll go with your fix for now!

- Jaakko Pöntinen

I just added a class of comment-logout to the log out link in the next version :)

Hey,

yay, thank you! :)

- JP

This class will be removed in GP 2.0, as we want to use the core text.

Instead of hiding it with CSS, do this:

add_filter( 'comment_form_defaults', 'tu_remove_logged_in_as' );
function tu_remove_logged_in_as( $defaults ) {
    $defaults['logged_in_as'] = '';

    return $defaults;
}
This archived topic is closed to new replies.