Support Forum

removing the ip address that appears in new post emails

IA Internet Able
Internet Able
Member

Hi,

Two questions

1) when a user makes a new post, I (as a moderator) receive an email with the posters ip address.

I’m a bit of a privacy freak and would rather this didn’t appear in the email. Is there a way to change this ?

2) who else would receive this ip address – subscriptions? Other mods?

Thanks in advance

4 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

This only appears to those admins/moderators signed up for admin notification emails. It will never be seen by your ordinary forum members

Interestingly – and typically! – this was actually added after much lobbying by our users!

MP Mr Papa
Mr Papa
Member

but there is a filter that can be used to strip it out from the emails to admins/mods if you really wanted…  but as Andy says, no regular users will see IP addresses…

IA Internet Able
Internet Able
Member

I guess you cant please all of the people all of the time … especially not webmasters 🙂

 

Could you tell me how I go out about setting up that filter?

YS Yellow Swordfish
Yellow Swordfish
Member

The filter in question is ‘sph_admin_email’. This passes 3 arguments: The $message (which, of course, is what needs to be returned), The $newpost array which contains the entire set of data for the new post. And an $id which is the user id of the admin the email is being compiled for.

So the IP address would then need to be extracted from the $message and the modified $message returned as a result. Not ideal and probably a case for a regular expression. Oh how I hate those!

For reference these filters are standard WordPress hooks and their use is described in the WP codex: http://codex.wordpress.org/Plugin_API