well wisher
asked 10 years ago

Hey guys i can see users email ids used as username in recent comments widget of my site instead of anonymous can you confirm this issue and get it resolved asap thanks

5 Answers
well wisher
answered 10 years ago

anyone?

well wisher
answered 10 years ago

it turned all comments anonymous !!!

BigHug
replied 10 years ago

That’s weird. As you can see in the code, i checked author id before convert their author name to anonymous so it should be that all new comments posted by anonymous users only.

well wisher
replied 10 years ago

yaa i know its weird but still its happening may be because you took the global $current_comment variable but dint used it as i see its commented over there using //
i think the code should be like something i have mentioned in answer below

well wisher
answered 10 years ago

Any lead on this ?

well wisher
answered 10 years ago

ok this is what the scenario is if user is logged in then the code works else not i think was testing it late at night

well wisher
answered 10 years ago

Guys can you confirm this issue?

BigHug
replied 10 years ago

Hi Well Wisher,
Sorry for my late reply, can you provide me an admin account for further checking, i want to improve the code that i sent to you before

well wisher
replied 10 years ago

Hi @BigHug at the moment the only thing i can provide is the link to my site where you can see the problem here you go http://brainlubricator.com/identify-fake-fraud-company/ check out the comments section there

well wisher
replied 10 years ago

as i already informed you above that the code works when logged in as admin but fails when the comment is made using the form without logging may be because you are checking the user_id eg 1 for admin 2 for author etc i and <=0 makes anonymous but using the comment_id may resolve this issue

well wisher
answered 10 years ago

@bighus i want you to have a look here i was thinking to implement these to achieve the purpose http://codex.wordpress.org/Function_Reference/comment_author

Displays the comment author name; that is, the one supplied by the commenter. If no name is provided (and “User must fill out name and email” is not enabled under Discussion Options), WordPress will assign “Anonymous” as comment author.
Use get_comment_author() to retrieve the value.

http://codex.wordpress.org/Function_Reference/comment_author_email
http://codex.wordpress.org/Function_Reference/comment_author_link
http://codex.wordpress.org/Function_Reference/get_comment_ID
http://codex.wordpress.org/Function_Reference/comment_ID
This is how wordpress do its anonymous comment thing i thought the answer to this problem may be found here i tried doing the stuff but achieved no success
Hope this helps

well wisher
answered 10 years ago

Hi @bighug the issue is still there even after the latest update and there are more problems like answer page is breaking scripts and answer form is not working

Powered by DW Question & Answer Pro