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 toggle a topic custom field table in the thread?

2 Posts
1 Users
0 Reactions
1,087 Views
Posts: 4
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
(@user1)
Active Member
Joined: 2 years ago
[#50960]

I'm using the Topic Custom Fields addon. I'm wondering is it possible to add a toggle link/button in the thread (e.g., in the Q&A layout), to show/hide the custom field table? E.g., a link/button that say "More Info" that show/hide the custom field table. I'm thinking something along the lines of adding a simple anchor element or button, and use javascript to show/hide the custom field table. It will be great if this can be added as a built-in feature for the Topic Custom Fields addon.

If it is not possible to add in as a built-in feature, can you advice on how to best customize this, perhaps there is a php template file for each of the layout that I may be able to edit? Though the cleaner way would be to have it part of the next release if possible.

Thank you very much!


1 Reply
Posts: 4
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
(@user1)
Active Member
Joined: 2 years ago

Found this filter hook below that is called just before the custom fields table, great! I'll mark this solved now.

add_filter('wpforo_topic_fields_before', 'custom_function', 10, 2);

function custom_function( $html, $post ) {

$html = ... // Inject HTML here 

return $html;

}


Reply
Share: