Shortcode_Block::render( array $attributes )

Summary

Render the block. The default behavior is to convert the block into a shortcode, which will then be rendered by do_shortcode


Parameters

$attributes

(array) (Required)


Return

(string)


Source

File: src/BigCommerce/Editor/Gutenberg/Blocks/Shortcode_Block.php

	public function render( $attributes ) {
		if ( empty( $attributes[ 'shortcode' ] ) ) {
			return sprintf( '[%s]', $this->shortcode );
		}
		return $attributes[ 'shortcode' ];
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.