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
Argument | Type | Description |
$tag | string | Tag name used for the card holder |
$card | array | Holds card layers and blocks definitions |
$settings | object | Holds 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 );