W3cubDocs

/WordPress

WP_Block_Type::render( array $attributes = array(), string $content = ): string

Renders the block type output for given attributes.

Parameters

$attributesarrayoptional
Block attributes.

Default:array()

$contentstringoptional
Block content.

Default:''

Return

string Rendered block type output.

Source

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 );
}

Changelog

Version Description
5.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_type/render