WP_Block_Type::render()
Renders the block type output for given attributes.
Method of the class: WP_Block_Type{}
No Hooks.
Return
String
. Rendered block type output.
Usage
$WP_Block_Type = new WP_Block_Type(); $WP_Block_Type->render( $attributes, $content );
- $attributes(array)
- Block attributes.
Default: empty array - $content(string)
- Block content.
Default: empty string
Changelog
Since 5.0.0 | Introduced. |
WP_Block_Type::render() WP Block Type::render code WP 6.7.1
public function render( $attributes = array(), $content = '' ) { if ( ! $this->is_dynamic() ) { return ''; } $attributes = $this->prepare_attributes_for_render( $attributes ); return (string) call_user_func( $this->render_callback, $attributes, $content ); }