Tribe__Events__Pro__Editor__Blocks__Related_Events::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)
Default value: array()
Return
(string)
Source
File: src/Tribe/Editor/Blocks/Related_Events.php
public function render( $attributes = array() ) {
$args['attributes'] = $this->attributes( $attributes );
$args['post_id'] = $post_id = tribe( 'events.editor.template' )->get( 'post_id', null, false );
$args['events'] = tribe_get_related_posts();
// Add the rendering attributes into global context
tribe( 'events-pro.editor.frontend.template' )->add_template_globals( $args );
return tribe( 'events-pro.editor.frontend.template' )->template( array( 'blocks', $this->slug() ), $args, false );
}
Changelog
| Version | Description |
|---|---|
| 4.6.2 | Introduced. |