Groups Forums offers numerous WordPress actions and filters for easy system customization. It utilizes custom post types and taxonomies, enabling developers familiar with these WordPress concepts to create tailored solutions for their clients.
Actions
groups_forums_topic_assigned
This action is invoked when a topic is assigned to a user
Parameters
$post_idThe topic ID$user_idThe user_id where the topic is assigned to$old_user_idThe user_id of the previous topic assignee
groups_forums_topic_submit_rejected
This action is invoked after a submitted topic is rejected
Parameters
- This action hook doesn’t provide any parameters.
groups_forums_topic_submit_accepted
This action is invoked after a submitted topic is accepted
Parameters
- This action hook doesn’t provide any parameters.
groups_forums_captcha_failed
This action is invoked if captcha validation fails
Parameters
- This action hook doesn’t provide any parameters.
Filters
groups_forums_only_authorized_members_can_comment
This filter allows to modify the message displayed when unauthorized members try to comment on a restricted topic.
Parameters
$message stringThe message displayed, default value ‘Only authorized members can comment on this topic.’
Returns
string
groups_forums_user_login_link
This filter allows to modify the user-login link, that is displayed in the new-topic submit form and in comments form for existing topics, when viewed by guests. Use with caution as malformed HTML will corrupt the link displayed.
Parameters
$link stringThe HTML link displayed
Returns
string
groups_forums_user_must_login_to_comment
This filter allows to modify the message displayed when comments appear to be closed on a topic and login is required.
Parameters
$message stringThe message appearing, default value ‘You must log in to post a comment.’
Returns
string
groups_forums_author_edit_topic_link
This filter allows to modify the author’s edit-topic link. Use with caution as malformed HTML will corrupt the link displayed.
Parameters
$link stringThe HTML link displayed
Returns
string
groups_forums_the_content_filter_priority
This filter allows to modify the priority of the_content and the_excerpt filter hooks.
Parameters
$priority intThe priority ofthe_contentfilter andthe_excerpthooks, default value 0
Returns
int
groups_forums_shout_level_threshold_title
This filter allows to modify the topic’s title shout level. Useful when topic title contains too much. uppercase characters.
Parameters
$shout_level floatThe shout level value, default 0.05
Returns
float
groups_forums_shout_level_threshold_content
This filter allows to modify the topic’s content shout level. Useful when topic content contains too much uppercase characters.
Parameters
$shout_level floatThe shout level value, default 0.10
Returns
float
groups_forums_filter_the_content
When this filter returns true, any occurrances of “[” and “]” found in the topic content, will be replaced by their equivalent HTML entities, to avoid shortcodes being recognized.
Parameters
$enabled booleanWhether the option to filter content is enabled, default true.
Returns
boolean
groups_forums_topic_submit
Whether to submit a topic
Parameters
$submit boolean, default true
Returns
boolean
groups_forums_captcha_validate
This filters allows to add captcha validation for new topic submission form, used in combination with groups_forums_captcha filter hook.
Parameters
$result booleanThe captcha validation result, default true$_POST arrayForm’s submitted data
Returns
boolean
groups_forums_captcha
Captcha validation field rendered in the new topic submit form, used in combination with groups_forums_captcha_validate filter hook. Use with caution as malformed HTML will corrupt the form displayed.
Parameters
$captcha_field stringThe captcha field added to the <form></form>, default value ”
Returns
string
groups_forums_topic_is_pending_review
This filter allows to change the message appearing when a topic is pending review. Use with caution as malformed HTML will corrupt the message displayed.
Parameters
$message stringThe HTML message appearing
Returns
string
groups_forums_user_must_login
This filter allows to change the message displayed when a guest is trying to submit a new topic. Use with caution as malformed HTML will corrupt the message displayed.
Parameters
$message stringThe message appearing for guests.
Returns
string
groups_forums_user_cannot_post
This filter allows to modify the message displayed when an unauthorized user is trying to submit a new topic. Use with caution as malformed HTML will corrupt the message displayed.
Parameters
$message stringThe message appearing for unauthorized users
Returns
string
groups_forums_search_output
This filter allows to modify the HTML output of the Groups Forums Search form. Use with caution as malformed HTML will corrupt the message displayed.
Parameters
$output stringThe HTML output of the search form
Returns
string
groups_forums_get_search_form_add_topic_post_type
This filter modifies search block to keep results among topics if requested.
Parameters
$modify_request booleanWhether to keep results among forum topics, defaulttrue.
Returns
boolean
groups_forums_get_search_form_info
This filter allows to modify the info message appearing in search form when results are kept among form topics. Use with caution as malformed HTML will corrupt the search form displayed.
Parameters
$message stringThe HTML message appearing after the search form input field
Returns
string
groups_forums_get_search_form
This filter allows to modify the search <form> HTML when the form is limited to the topic post type. Use with caution as malformed HTML will corrupt the search form displayed.
Parameters
$form stringThe HTML for the search form
Returns
string
groups_forums_template_base
Modifies the templates base location. Please note that no trailing slash is needed.
Parameters
$output stringBase location, defaults to ‘groups-forum’
Returns
string
groups_forums_extend_the_content
Whether to add information for topic forums and topic tags, to the content of a single ‘topic’ post. When enabled( default ), will render:
'Posted in %s' , listing the forum(s) where the topic is filed under
'Tags %s', listing the topic tags added to the topic.
Parameters
$enable booleanThe filter returnstrueby default
Returns
boolean
groups_forums_add_topic_forum_bits
Whether to display topic or forum bits. When enabled, forum and tag links are added to topics and a link to post a new topic, is added to forum descriptions for users who can post in a forum.
Parameters
$enable booleanDefaulttrue$post_type stringThe post-type currently displayed and can be ‘topic’ or ‘forum’$idThe ID of the topic or forum
Returns
boolean
groups_forums_topic_the_content_suffix
This filter allows to modify the HTML container, rendering the topic bits, that is displayed to the content of a single ‘topic’ post. Use with caution as malformed HTML will corrupt the HTML displayed.
Parameters
$suffix stringThe HTML rendered- $topic object Instance of the Topic
Returns
string
groups_forums_forum_archive_description_suffix
This filter allows to modify the HTML container, rendering the forum bits, that is displayed in the archive description of forums. Use with caution as malformed HTML will corrupt the HTML displayed.
Parameters
$suffix stringThe HTML rendered$topic objectInstance of Topic$forum objectInstance of Forum$description stringExisting description of the archive
Returns
string
groups_forums_forum_term_description_suffix
This filter allows to modify the HTML rendered, when using the Term Description block. Use with caution as malformed HTML will corrupt the HTML displayed.
Parameters
- $suffix
stringThe HTML rendered $topic objectInstance of the Topic$object objectInstance of WP_Term$block_content stringHTML rendered for this block$parsed_block arrayParsed block$block objectInstance of WP_Block
Returns
string
groups_forums_forum_post_topic
This filter allows to modify the ‘Post a new Topic’ link for users who are allowed to, on the current forum. Use with caution as malformed HTML will corrupt the HTML displayed.
Parameters
$output stringThe HTML rendered$post objectWP_Post$wp_queryobject The current query
Returns
string
