WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been searching and searching for a while now to see if there's a way to allow people who are logged into my BuddyPress site to make a post on the activity section as "anonymous" or as their screen name, an ideal additional option would allow comments on that post to be made as anonymous or their screen name as well. Why would someone want this? I have no idea, but my client wants it one way or another.

How can I do that?

share|improve this question
Note that questions for plugin recommendations or job offerings are off topic here, so I took that out. – toscho Mar 28 '13 at 1:42
@tosco - So I guess also an answer that involves a plugin recommendation would be off topic ? – krembo99 Mar 28 '13 at 2:02
You would need to create an anonymous user and then hook into a filter while the comment is being processed. – Dan Mar 28 '13 at 5:25

In order to do what you are asking, there first needs to exist an anonymous user.

Assuming this user exists, there are just a few steps:

1) modify the comment form to include the anonymous check box.

2) detect whether the box is checked.

3) if the box is checked, use the comment_save_pre filter to change the user's info to that of the anonymous user.

Hope that points you in the right direction!

EDIT: Be sure that you have the comments settings in your dashboard only allowing loggedin users to comment.

share|improve this answer

protected by Community May 19 '15 at 7:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.