Limited Time Offer

Save 25% on our plugins with this coupon:

LOVEWORDPRESS

Buy Now
Skip to content
TaxoPress
  • TaxoPress
  • Tag Groups
  • Docs
  • Blog
  • Support
  • Login
Buy Now
TaxoPress

Tag Groups: Getting Started

  • Introduction to Tag Groups
  • How to Install Tag Groups Free
  • How to Install Tag Groups Pro
  • First Steps With Tag Groups
  • Tag Groups Free vs Pro

How to Use Groups for Tags

  • Creating and Editing Groups
  • Filter Tag Groups on the Tags Screen
  • Bulk Actions for Groups on the Tags Screen
  • Organizing Groups with a Parent Level
  • Using the Tag Groups Metabox on the Post Edit Screen

Display Options for Tags

  • How To Use Gutenberg Blocks With Tag Groups
  • How to Use Shortcodes With Tag Groups
  • Tag Groups Themes: Design and Colors
  • How to Design Tag Colors in Tag Groups
  • How to Modify a Theme in Tag Groups
  • Create Your Own Accordion and Tab Themes

Tag List

  • Tag List – Overview
  • Tag List – Gutenberg Block
  • Tag List – Shortcode Parameters

Tabbed Tag Cloud

  • Tabbed Tag Cloud – Overview
  • Tabbed Tag Cloud – Gutenberg Block
  • Tabbed Tag Cloud – Shortcode Parameters
  • Tabbed Tag Cloud – Themes

Alphabetical Tag Index

  • Alphabetical Tag Index – Overview
  • Alphabetical Tag Index – Gutenberg Block
  • Alphabetical Tag Index – Shortcode Parameters

Alphabetical Tag Cloud

  • Alphabetical Tag Cloud – Overview
  • Alphabetical Tag Cloud – Gutenberg Block
  • Alphabetical Tag Cloud – Shortcode Parameters
  • Alphabetical Tag Cloud – Themes

Accordion Tag Cloud

  • Accordion Tag Cloud – Overview
  • Accordion Tag Cloud – Gutenberg Block
  • Accordion Tag Cloud – Shortcode Parameters
  • Accordion Tag Cloud – Themes

Tag Groups Info

  • Tag Groups Info – Overview
  • Tag Groups Info – Shortcode Parameters

Show Tags Under Posts (Pro)

  • How to Show Tag Groups on Posts
  • Change the Icons on Tags Under Posts

Shuffle Box (Pro)

  • Shuffle Box – Overview
  • Shuffle Box – Gutenberg Block
  • Shuffle Box – Shortcode Parameters
  • Create a Custom Color Scheme for Shuffle Box
  • Hide the “not assigned” button in the Shuffle Box

Simple Tag Cloud (Pro)

  • Simple Tag Cloud – Overview
  • Simple Tag Cloud – Gutenberg Block
  • Simple Tag Cloud – Shortcode Parameters

Table Tag Cloud (Pro)

  • Table Tag Cloud – Overview
  • Table Tag Cloud – Gutenberg Block
  • Table Tag Cloud – Shortcode Parameters

Post List (Pro)

  • Post List – Overview
  • Post List – Gutenberg Block
  • Post List – Shortcode Parameters

Dynamic Post Filter (Pro)

  • Dynamic Post Filter – Overview
  • Dynamic Post Filter – Gutenberg Block
  • Dynamic Post Filter – Shortcode Parameters
  • I Don’t See Posts In the Dynamic Post Filter

Tag Cloud Search (Pro)

  • Tag Cloud Search – Overview
  • Tag Cloud Search – Gutenberg Block
  • Tag Cloud Search – Shortcode Parameters

Tag Groups Menu (Pro)

  • Tag Groups Menu – Overview
  • Tag Groups Menu – Shortcode Parameters

Toggle Post Filter (Pro)

  • Toggle Post Filter – Overview
  • Toggle Post Filter – Shortcodes Overview
  • Toggle Post Filter, Posts – Gutenberg Block
  • Toggle Post Filter, Posts – Shortcode Parameters
  • Toggle Post Filter, Menu – Gutenberg Blocks
  • Toggle Post Filter, Menu – Shortcode Parameters
  • Toggle Post Filter, Text Search – Gutenberg Block
  • Toggle Post Filter, Text Search – Shortcode Parameters
  • Toggle Post Filter, Slider Button – Gutenberg Block
  • Toggle Post Filter, Slider Button – Shortcode Parameters
  • Toggle Post Filter, Order Menu, Gutenberg Block
  • Toggle Post Filter, Order Menu – Shortcode Parameters
  • Toggle Post Filter, Reset Button – Shortcode Parameters

Tag Groups: Settings

  • The Home Screen in Tag Groups
  • Taxonomies and the Tag Groups Plugin
  • Front End Settings
  • Back End Settings in Tag Groups
  • Tools
  • Troubleshooting
  • Control Who Can Edit the Tag Groups

Tag Groups: Frequently Asked Questions

  • Glossary of Useful Words for Tag Groups
  • How to Display Tags in a Custom Sort Order?
  • Can I Use Tag Groups Multiple Times on The Same Page?
  • Which Tag Groups Feature Do I Need?
  • Can I Use the Tag Groups Plugin with Pages?
  • Can I Use the Tag Groups plugin with Categories?
  • How to Make the Alphabetical Tag Index or the Tag List Responsive?
  • Can I Use Tag Groups with Custom Taxonomies?
  • What are the Minimum System Requirements to Install Tag Groups?
  • “The free Tag Groups plugin cannot be active together with Tag Groups Pro.”

Tag Groups: Troubleshooting

  • Tags Not Visible in the WordPress Admin After Installing Tag Groups
  • Debugging a WordPress Ajax Error
  • Shortcodes Don’t Work Inside Widgets
  • I Cannot Use Multiple Tag Clouds on the Same Page
  • I Don’t See All Tags in the Tag Meta Box
  • How To Use The Debug Log in Tag Groups
  • Instead of the Tag Cloud There’s An Empty Space
  • Can Not Save HTML in the Tag Description
  • Tag Cloud: When I Click on a Tag, the Posts Don’t Differentiate by Groups
  • “Error loading block: The response is not a valid JSON response.”

Questions About Post Filters

  • Using the Post Filter on Frontend URLs
  • How to Choose a Custom Order in the Post Filter
  • How to Change the Length of the Post Excerpts
  • Change the Size of the First Posts in the Masonry Layout
  • Limit the Size of the Menu in the Dynamic Post Filter

Tag Groups: Maintenance and Optimization

  • How to Reduce the Number of Loaded Scripts for Better Speed and SEO
  • How to Improve the Performance of the Toggle Post Filter/Dynamic Post Filter
  • Running Maintenance
  • How to Improve the Speed of Tag Groups
  • Migrating your Tags and Posts to Tag Groups

Tag Groups: For Developers

  • Tag Groups and the REST API
  • Filters and Actions in Tag Groups
  • Modifying the Post Query
  • Modifying the Term Query
  • Using Tag Groups in Theme Files
  • Useful Constants for the Tag Groups Plugin

Tag Groups Integrations

  • Integration with WooCommerce Attributes
  • Does Tag Groups Work with the Polylang Plugin?
  • Translating Tag Group Names With WPML
  • Home
  • TaxoPress Documentation
  • The Tag Groups Plugin
  • Tag Groups: For Developers
  • Filters and Actions in Tag Groups

Filters and Actions in Tag Groups

Table of Contents
  • Actions
  • Filters
    • View Filters
    • Term Filters
    • Group Filters
    • Filters for Tag Clouds
    • Filters for Live Post Filters
    • Post Tags (Under Posts)
    • Admin

This is a guide to the filter hooks and action hooks of the Tag Groups plugin. If a feature is only in the Pro version of the plugin, the corresponding hooks will also be limited to the Pro version.


Actions #

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 nameArguments of callbackTriggered when
term_group_savedvoidafter information about (one or more) term groups was saved
term_group_deletedinteger: group IDafter a group has been deleted
groups_of_term_savedinteger: term ID
integer or array of integers: tag group IDs
after a term’s assignment to groups was saved

Filters #

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 );

View Filters #

Filter the arguments or the final HTML of views (templates) that we use for pages or page fragments on the front and back end.

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_view-{$view_slug}string: content (HTML)stringfilters 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)stringsee tag_groups_view-{$view_slug}; These are the views int the /premium/views folder.
tag_groups_view_attsarray: attributes
string: slug, see tag_groups_view-{$view_slug}
array, must contain same fields and data types as the attributesfilters the attributes before they are being sent to the view
tag_groups_premium_view_attsarray: attributes
string: slug, see tag_groups_view-{$view_slug}
array, must contain same fields and data types as the attributesfilters the attributes before they are being sent to the view (premium part)

Term Filters #

Filter the terms that were retrieved from the database.

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_get_termsWP_Term[]|int[]|string[]|string|WP_Error: the retrieved terms; The type depends on the fields parameter; your callback should also consider errors
integer: group ID, if applicable
string|string[]: taxonomies
bool|int: Whether to hide terms with post count zero
string: fields What to return. See WP’s get_terms()
int: post_id: This parameter is only relevant if the tags depend on the language of a post
string: orderby
string: order
string: include
string exclude
integer: threshold
same as the first parameter (terms)filters the terms (tags); please note that not all parameters are in use, depending on the purpose that these tags are used for (tag clouds, backend)

Group Filters #

Here you can filter data about tag groups after loading from the database, or before saving it.

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_load_group_idsarray of integersarray (same as argument)filters the group IDs after loading from the database
tag_groups_load_group_labelsarray; keys are group IDs, values are the labels (names)array (same as argument)filters the group labels after loading from the database
tag_groups_load_group_positionsarray: keys are group IDs, values are the positions (determining the order)array (same as argument)filters the group positions after loading from the database
tag_groups_save_group_idsarray of integersarray (same as argument)filters the group IDs before saving to the database
tag_groups_save_group_labelsarray; keys are group IDs, values are the labels (names)array (same as argument)filters the group labels before saving to the database
tag_groups_save_group_positionsarray: keys are group IDs, values are the positions (determining the order)array (same as argument)filters the group positions before saving to the database

Filters for Tag Clouds #

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_cloud_tag_innerstring: content
integer: term ID
string: shortcode identifier
stringfilters all tag names in tag clouds
tag_groups_cloud_tag_outerstring: content (HTML)
integer: term ID
string: shortcode identifier
stringfilters all tag names in tag clouds, including the wrapping <span> element
tag_groups_cloud_tag_prependstring: content (HTML)
integer: term ID
integer: font size
integer: post count of this tag
string: shortcode identifier
stringfilters 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_appendstring: content (HTML)
integer: term ID
integer: font size
integer: post count of this tag
string: shortcode identifier
stringfilters 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_htmlstring: content (HTML)
string: shortcode identifier
array: shortcode parameters
stringfilters the complete HTML output of all tag clouds
tag_groups_tag_titlestring: title
string: shortcode name
string: tag description
integer: post count
stringfilters the HTML title attribute of each tag that appears as tooltip on mouseover
tag_groups_custom_titlestring: title
string: shortcode name
integer: post count
stringFilters the title attribute of a tag before replacing all placeholders

Filters for Live Post Filters #

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_excerptobject: WP_Post objectstringUse 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.
excerpt_lengthintegerintegerLength of the excerpt in post templates
excerpt_morestringstringEllipse characters (…) if the excerpt is truncated
tag_groups_tpf_before_queryarray: WP_Query arguments when searching for postsarray (valid arguments for WP_Query)This callback filters the post query of the Toggle Post Filter just before posts are retrieved.
tag_groups_dpf_before_queryarray: WP_Query arguments when searching for postsarray (valid arguments for WP_Query)This callback filters the post query of the Dynamic Post Filter just before posts are retrieved.
tag_groups_before_placeholdersstring: The HTML template
object: WP_Post object (the currently processed post)
HTML for a post with optional placeholders This callback filters the post template before starting to process the placeholders for a post. It is run for each post that is in the queue for output. This filter can be used to create own placeholders or change the post HTML depending on the post.

Post Tags (Under Posts) #

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_post_termsstring: content (HTML)stringfilters a string containing the table of post tags, in TagGroups_Premium_Post_Terms::get_table()

Admin #

Filter nameArguments of callbackReturn data type of callbackFilters what
tag_groups_allow_duplicate_group_namesbooleanbooleanwhether it is allowed to add two groups with identical names; default is false if no parent groups are in use, otherwise true
Tag Groups and the REST APIModifying the Post Query
Table of Contents
  • Actions
  • Filters
    • View Filters
    • Term Filters
    • Group Filters
    • Filters for Tag Clouds
    • Filters for Live Post Filters
    • Post Tags (Under Posts)
    • Admin

Recent Posts

  • How to Find the IDs of WordPress Tags, Posts or Categories May 24, 2023
  • How to Change the Design of Accordions and Tabbed Tag Clouds May 16, 2023
  • How to Add Custom Designs to Terms in Tag Groups May 15, 2023
  • Find The Most Used Tags On Your WordPress Site May 14, 2023
  • What is a Tag Slug in WordPress? May 11, 2023

Testimonials

I’ve used this for a long time and it is really a great plugin. If you need terms tagging capabilities, this is great!

woodb01

Simply the best tags plugin for WordPress. The support is great, the developer very friendly and the plugin is very powerful with unlimited functionality and possibilities. Congratulations!

salvia49

Important Links

  • TaxoPress Demos
  • Frequently Asked Questions
  • About the TaxoPress Team
  • Terms of Service
  • TaxoPress Affiliates
  • Logo and Brand Materials

Our Projects

  • PublishPress
  • MetaSlider
  • KinshiPress
  • Ramble Ventures
  • Logtivity

© 2023 TaxoPress

Facebook Twitter
Scroll to top
  • TaxoPress
  • Tag Groups
  • Docs
  • Blog
  • Support
Search