Will Wonka asking you to tell him again what WordPress can't do.

Hiding Comment Emails

Obscuring emails in WordPress . . . the comments edition. This is likely overkill but given that VCU has concerns about student emails being divulged via group emails we figured it wouldn’t hurt. I don’t want a class requiring commenting on student sites and that resulting in student unintentionally divulging their VCU emails because they’re logged in. You can see more details on email concerns at VCU (and likely other Virginia universities) at the VCU House Bill 1 site. This is going to go into our production code soon but seems to be working fine in development land. If you’re not a super-admin you will no longer see emails in the main comments view. In the quick edit view, I opted to get a little more nuanced. Email addresses without VCU in them will show normally. I figured this might be useful for contacting outside people. VCU has three or four email patterns but all of them have VCU in the address so I opted to just look for VCU in the email string using strpos. If it finds VCU then it spits back a generic sanitized email, sanitized_email@vcu.edu.1 I thought this would make it more obvious that there wasn’t an error but that emails were being cleaned intentionally. And finally, the single comment edit view. Thanks to Jeremy Felt […]