Tribe__Editor__Blocks__Abstract::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/Abstract.php
public function render( $attributes = array() ) {
if ( version_compare( phpversion(), '5.4', '>=' ) ) {
$json_string = json_encode( $attributes, JSON_PRETTY_PRINT );
} else {
$json_string = json_encode( $attributes );
}
return
'<pre class="tribe-placeholder-text-' . $this->name() . '">' .
'Block Name: ' . $this->name() . "\n" .
'Block Attributes: ' . "\n" . $json_string .
'</pre>';
}
Changelog
| Version | Description |
|---|---|
| 4.8 | Introduced. |