/card/tag

DescriptionDescription

This filter is called when a card is lay out.

It allows to modifies tag name of card holders in grids. By default the tag name is article. Because, depending of the markup of your page, you may need to change this tag to be 100% W3C compliant.

ArgumentsArguments

ArgumentTypeDescription
$tagstringTag name used for the card holder
$cardarrayHolds card layers and blocks definitions
$settingsobjectHolds grid settings

ExampleExample

PHP
functions.php
function prefix_change_card_tag( $tag, $card, $settings ) {

	// If it matches grid id 1.
	if ( 1 === $settings->id ) {
		$tag = 'div';
	}

	return $tag;

}
add_filter( 'wp_grid_builder/card/tag', 'prefix_change_card_tag', 10, 3 );