Tribe__Events__Pro__Editor__Blocks__Additional_Field::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/Additional_Field.php
public function render( $attributes = array() ) {
$args['attributes'] = $this->attributes( $attributes );
// Add the rendering attributes into global context
tribe( 'events-pro.editor.frontend.template' )->add_template_globals( $args );
$type = isset( $attributes['type'] ) ? $attributes['type'] : 'text';
$location = array( 'blocks', 'additional-fields', $type );
return tribe( 'events-pro.editor.frontend.template' )->template( $location, $args, false );
}
Changelog
| Version | Description |
|---|---|
| 4.5 | Introduced. |