I have a recurring problem: whenever I respond to messages from my support forum, I realize that I have to request access to the WordPress administration console to make some minor changes. But all tickets are public, and obviously I can’t ask my users to enter confidential data in their tickets. Sometimes i ask them tu use my contact form but to be honest, this is not a good solution because often I don’t link the message I get to the ticket on the forum.
Private BBpress messages
So I was inspired by an article by Pippin Williamson to create a simple and effective system which allows forum users to enter data that only administrators can see. To achieve this, I simply added a function that allows bbPress to use shortcodes in forum posts content. Then i created a second function that adds a new shortcode. This simple is very basic but works well.
So, basically, when a forum user enters a message between [ private ] brackets and posts its ticket here is what everyone sees:
[alert type=”warning”]This content is private[/alert]
and here is what administrators see:
[alert type=”notice”]Here is the private content (only admins see this message)[/alert]
Pretty nice isn’t it?
Here is the code to do this, just place it in your functions.php or inside a custom plugin: