I'm still looking for a way to add a contact form to my "listing". I've disabled the reply system in that specific forum and its topics, and I would like to add a third-party contact form short code in a custom field. The only thing is. I'll need this field to be hidden from the users and only visible to admin in backend. In the front-end, the user will be able to see the short code rendered in the content using a text editor post type or something similar.
Maybe if I can add the short code as a default text.
I really would love to see an answer to this question as well. We hoped with topic custom fields plugin we could store some hidden information for admin consumption only as well.
The only way is using the hook which will be available in the next wpForo version. I mean in the 2.1.0 version. The hook code should be used as PHP through Code Snippets plugin, or it should be added in functions.php file of current active WordPress theme:
add_filter('wpforo_topic_fields_filter', function( $display, $field ){ // Unique Key Names of fields you want to display only to admins $admin_only_fields = ['field_key_1', 'field_key_2']; if( !empty( $admin_only_fields ) && !current_user_can( 'administrator' ) ){ if( in_array( $field, $admin_only_fields, true ) ) return false; } return $display; }, 10, 2);
In the script above, you should change the field_key_1 and filed_key_2 to the keys of your fields.
If you cannot wait till the next wpForo update (2.1.0 or to 2.0.10 version), then you can manually add the change in /wp-content/plugins/wpforo/classes/Posts.php file which will allow you to use the hook mentioned above:
I'm sorry @tomson if I insist, but for me this thing is almost fundamental. I have to hide the link field in some posts from guests. That is, the field must be visible only to registered users. Can I use the code above to do this? If the answer is yes, how should I change the entry, to point to the registered users instead of the administrator?
There is no an easy way to add disclaimer here. You should use "admin note" in wpForo > Tools > Admin Note tab and show it for certain usergroup on the top of the forum: