# Dynamic Tags Groups

Elementor Core Advanced Dynamic Tags List

To simplify navigation, all tags are arranged into groups. This allows users to quickly scan the list and scroll to the group that suits them.

# Available Groups

Elementor Pro adds the following groups:

  • Post - Post related dynamic data.
  • Archive - Theme archive related dynamic data.
  • Site - Site related dynamic data.
  • Media - Dynamic data based on media files.
  • Actions - Custom dynamic data.
  • Author - Post author dynamic data.
  • Comments - Post comments dynamic data.

If you would like to use the groups added by Elementor Pro, your addons must make sure Elementor Pro was loaded.

# Applying Groups

When creating new dynamic tags, you can set the tag group by returning group names with the get_group() method:

class Elementor_Test_Tag extends \Elementor\Core\DynamicTags\Tag {

	public function get_group(): array {
		return [ 'action' ];
	}

}
1
2
3
4
5
6
7

# Creating New Groups

Elementor Pro’s dynamic tags manager lets external developers create custom groups using the elementor/dynamic_tags/register_tags action hook:

/**
 * Register new dynamic tag group
 *
 * @since 1.0.0
 * @param \Elementor\Core\DynamicTags\Manager $dynamic_tags_manager Elementor dynamic tags manager.
 * @return void
 */
function register_new_dynamic_tag_group( $dynamic_tags_manager ) {

	$dynamic_tags_manager->register_group(
		'group-name',
		[
			'title' => esc_html__( 'Group Label', 'textdomain' )
		]
	);

}
add_action( 'elementor/dynamic_tags/register', 'register_new_dynamic_tag_group' );
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18