Hero
Wow your readers with a great introduction to your articles
Last modified: June 2, 2025
Block name
t2/hero
Hooks
block-library/src/hero/block.php
Filter the image size used for the hero image.
apply_filters( 't2/block/hero/image/size', string $size, array $attributes )
Parameter | Type | Description |
---|---|---|
$size |
string |
Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order). |
$attributes |
array |
Block attributes. |
Filter the image used for the hero image.
apply_filters( 't2/block/hero/image', string $image_wrapper, array $attributes )
Parameter | Type | Description |
---|---|---|
$image_wrapper |
string |
The image wrapper. |
$attributes |
array |
Block attributes. |
Properties (t2.json)
allowedBlocks
string[]Allowed innerblocks
Innerblock template
features
Show the editor alignment matrix.
Show the media backdrop option.
Style properties
Gap
- --t2-hero-spacing-gap
- Theme.json: wp.custom.t2-hero.spacing.gap
- Default: 1rem
Padding
- --t2-hero-spacing-padding
- Theme.json: wp.custom.t2-hero.spacing.padding
- Default: 1rem
Min Height
- --t2-hero-min-height
- Default: 25rem
Dim
- --t2-hero-dim
- Default: 0.5
Background Color
- --t2-hero-background-color
- Default: #000