Block::render( array $attributes = array() )
Since we are dealing with a Dynamic type of Block we need a PHP method to render it.
Contents
Parameters
- $attributes
-
(array) (Optional) The block attributes.
Default value: array()
Return
(string) The block HTML.
Source
File: src/Events/Blocks/Archive_Events/Block.php
public function render( $attributes = [] ): string {
$args['attributes'] = $this->attributes( $attributes );
// Add the rendering attributes into global context.
tribe( 'events.editor.template' )->add_template_globals( $args );
return tribe( 'events.editor.template' )->template( [ 'blocks', $this->slug() ], $args, false );
}
Changelog
| Version | Description |
|---|---|
| 6.3.3 | Introduced. |