The filter hooks and action hooks of the premium version are only available if the plan enables the corresponding feature. You find the hooks of the free version on this page.
Hook into an action with add_action(). Example:
function group_is_gone_message( $group_id ) {
echo "Group {$group_id} is gone!";
}
add_action( 'term_group_deleted', 'group_is_gone_message' );
Action name | Arguments of callback | Triggered when |
---|---|---|
term_group_saved | void | after information about (one or more) term groups was saved |
term_group_deleted | integer: group ID | after a group has been deleted |
groups_of_term_saved | integer: term ID integer or array of integers: tag group IDs | after a term’s assignment to groups was saved |
Hook into a filter with add_filter(). Examples:
function wrap_as_gift( $html ) {
return "<div class='wrapping_paper'>" . $html . "</div>";
}
add_filter( 'tag_groups_post_terms', 'wrap_as_gift' );
function add_my_icon_to_accordion_tag( $html, $id, $font_size, $post_count, $shortcode ) {
if ('tag_groups_accordion' != $shortcode) {
return $html;
}
return $html . '<img src="https://example.com/my-icon.png" style="height:' . $font_size . 'px"/>';
}
add_filter( 'tag_groups_cloud_tag_append', 'add_my_icon_to_accordion_tag', 10, 5 );
Filter name | Arguments of callback | Return data type of callback | Filters what |
---|---|---|---|
tag_groups_view-{$view_slug} | string: content (HTML) | string | filters a string that contains the HTML of a view before output. Find possible view_slugs in the code (in the views folders, use the following folder name, a dash and the part before .view.php ; example for a filter name: tag_groups_view-partials-admin_notice ) |
tag_groups_premium_view-{$view_slug} | string: content (HTML) | string | see tag_groups_view-{$view_slug}; These are the views int the /premium/views folder; example for a filter name: tag_groups_premium_view-shortcodes-tpf_menu_slider_button |
tag_groups_post_terms | string: content (HTML) | string | filters a string containing the table of post tags, in TagGroups_Premium_API::post_terms |
tag_groups_cloud_tag_inner | string: content integer: term ID string: shortcode identifier | string | filters all tag names in tag clouds |
tag_groups_cloud_tag_outer | string: content (HTML) integer: term ID string: shortcode identifier | string | filters all tag names in tag clouds, including the wrapping <span> element |
tag_groups_cloud_tag_prepend (since 1.38.3) | string: content (HTML) integer: term ID integer: font size integer: post count of this tag string: shortcode identifier | string | filters all HTML prepended to tags in tag clouds, including the <span> element; if nothing is prepended, it filters an empty string so that you have the option to anyway prepend something |
tag_groups_cloud_tag_append (since 1.38.3) | string: content (HTML) integer: term ID integer: font size integer: post count of this tag string: shortcode identifier | string | filters all HTML appended to tags in tag clouds, including the element; if nothing is appended, it filters an empty string so that you have the option to anyway append something |
tag_groups_cloud_html | string: content (HTML) string: shortcode identifier array: shortcode parameters | string | filters the complete HTML output of all tag clouds |
tag_groups_template_custom_field | mixed: value returned by get_post_meta() string: custom field name integer: post ID | string or array of strings1 | filters the value of a custom field for output in a post template for the placeholder {custom_field:…} in the Toggle Post Filter, Dynamic Post Filter or Post List |
tag_groups_tag_title | string: title string: shortcode name string: tag description integer: tag count | string | filters the HTML title attribute of each tag that appears as tooltip on mouseover |
tag_groups_excerpt (since version 1.36.4) | object: WP_Post object | string | Use a callback function to create a custom excerpt for the placeholder {post_excerpt} in a post template in the Toggle Post Filter, Dynamic Post Filter or Post List. The function needs to take care of proper encoding and sanitation and it must make sure that HTML is self-consistent and that no tags remain open. |