Print dynamic block information as a JS variable.

Description Description

Allows us to ensure we only add visibility attributes to static blocks. Prevents an issue causing rest api validation issues during attribute validation because it’s impossible to register custom attributes on a block.

Top ↑

Return Return


Top ↑

Source Source

File: libraries/lifterlms-blocks/includes/class-llms-blocks.php

	public function admin_print_scripts() {

		$screen = get_current_screen();
		if ( ! $screen || ( empty( $screen->is_block_editor ) && 'customize' !== $screen->base ) ) {

		echo '<script>window.llms.dynamic_blocks = ' . wp_json_encode( $this->get_dynamic_block_names() ) . ';</script>';


Top ↑

Changelog Changelog

Version Description
2.0.0 Since WordPress 5.8 blocks are available in widgets and customizer screen too.
1.5.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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