Trait_Block_Pattern_Options
Trait for managing and rendering integrated block pattern references.
Table of Contents
Methods
- render_block_pattern() : void
- Renders a block pattern by slug.
- render_block_pattern_in_post_context() : void
- Renders a block pattern in the context of a post.
- get_block_pattern_choices() : array<string|int, mixed>
- Returns all configured block patterns for use in ACF select fields.
Methods
render_block_pattern()
Renders a block pattern by slug.
public
static render_block_pattern(string $block_pattern_slug) : void
Parameters
- $block_pattern_slug : string
-
The slug of the pattern to render.
render_block_pattern_in_post_context()
Renders a block pattern in the context of a post.
public
static render_block_pattern_in_post_context(int $post_id, string $block_pattern_slug) : void
Parameters
- $post_id : int
-
The id of the post.
- $block_pattern_slug : string
-
The slug of the pattern to render.
get_block_pattern_choices()
Returns all configured block patterns for use in ACF select fields.
protected
get_block_pattern_choices() : array<string|int, mixed>