Skip to content

Instantly share code, notes, and snippets.

@greenhornet79
Last active February 3, 2017 16:02
Show Gist options
  • Save greenhornet79/b7252dae6d1773a1fab3d374eeb33226 to your computer and use it in GitHub Desktop.
Save greenhornet79/b7252dae6d1773a1fab3d374eeb33226 to your computer and use it in GitHub Desktop.
<?php
add_filter('comment_form_defaults', 'endo_comment_changes');
function endo_comment_changes( $defaults ) {
$current_user = wp_get_current_user();
$defaults['logged_in_as'] = '<p class="logged-in-as">' . sprintf( __( '<small>You are currently logged in as <a href="%1$s">%2$s</a> ... Is this not you? <a href="%3$s" title="Log out of this account">Log out by clicking here.</a></small>' ), admin_url( 'profile.php' ), $current_user->user_login, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>';
return $defaults;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment