Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] How to turn off Topic Custom Fields for certain forums (by ID)

1 Posts
1 Users
0 Reactions
2,093 Views
Astghik
Posts: 6645
Admin
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astgh)
Illustrious Member
Joined: 8 years ago
[#6855]

If you want to turn off Topic Custom Fields for certain forums (by ID) follow the steps below:

1. Open the /wp-content/plugins/wpforo/wpf-includes/class-posts.php file

2. Find the following line:

public function get_topic_fields($forum, $values = array(), $guest = false ){

3. insert the code below after the line mentioned above (in step 2)

$only_defaults = in_array( $forum['forumid'], array(X) );

X is a forum ID, where you need to hide the topic custom fields. Comma-separated all form IDs where you need to hide those. For example, if you want to hide the fields from the forums with 7, 8, 25 ID use the code below:

$only_defaults = in_array( $forum['forumid'], array(7, 8, 25) );

4. Replace the code in the next line :

$fields = $this->fields_structure_full_array( $this->get_topic_fields_structure(false, $forum['cat_layout'], $guest), $used_fields );

with the following one:

$fields = $this->fields_structure_full_array( $this->get_topic_fields_structure($only_defaults, $forum['cat_layout'], $guest), $used_fields );

Important:

We do all our best to include the feature in the addon ASAP. This is just a temporary solution. You'll lose the changes once you update the wpForo plugin. 

Just make sure the version is higher than 1.8.4. 


Share:
Scroll to top