Ok thematrixit, i will try to fix it.
Mmmm ok i figured out.
Check the \wp-includes\comment-template.php, on row 1536 you will find this:
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>'
So, for the gallery comments logout, get_permalink( $post_id ) is not good! But is better to not change it inside core file, so i will use a filter:
add_filter('comment_form_defaults','rcwd_comment_form_defaults');
function rcwd_comment_form_defaults($defaults){
global $user_identity;
$defaults['logged_in_as'] = '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', esc_attr($_SERVER["REQUEST_URI"]) ) ) ) . '</p>';
}
So i used esc_attr($_SERVER[“REQUEST_URI”]) to retreive the current url.
Remember that this will be a change for all comments in website.
Consider it a temporary fix, i hope to find a better way to include in my plugin.
Added it after the 352nd row in comments.php (version 0.1.5), also tried the one from readme file, but still not working.
Sorry thematrixit, i forgot to mention to insert that filter and function inside file functions.php of your theme and also a forgot a line inside that function.
add_filter('comment_form_defaults','rcwd_comment_form_defaults');
function rcwd_comment_form_defaults($defaults){
global $user_identity;
$defaults['logged_in_as'] = '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', esc_attr($_SERVER["REQUEST_URI"]) ) ) ) . '</p>';
return $defaults;
}
Found that the same thing happens when sharing comments on Facebook with Simple Facebook Connect – the post url is not correct, there is this same kind of url with the same “rcwd-ngg” string.