LLMS_Shortcodes_Blocks::register_blocks()

Registers shortcode blocks.


Return Return

(void)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcodes.blocks.php

	public function register_blocks(): void {
		$blocks = $this->get_config();

		foreach ( $blocks as $name => $args ) {
			$block_dir = $args['path'] ?? LLMS_PLUGIN_DIR . "blocks/$name";

			if ( file_exists( "$block_dir/block.json" ) ) {
				register_block_type(
					$block_dir,
					array(
						'render_callback' => array( $this, 'render_block' ),
					)
				);
			}
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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