LLMS_Blocks_Assets::editor_assets()

Enqueue block editor assets.


Return Return

(void)


Top ↑

Source Source

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

	 */
	public function editor_assets() {

		$screen = get_current_screen();
		if ( $screen && ! in_array( $screen->base, array( 'post', 'site-editor' ), true ) ) {
			return;
		}

		if ( $this->use_bc_assets() ) {
			$this->assets->enqueue_script( 'llms-blocks-editor-bc' );
		}

		$this->assets->enqueue_script( 'llms-blocks-editor' );
		$this->assets->enqueue_style( 'llms-blocks-editor' );

		wp_localize_script(
			'llms-blocks-editor',
			'llmsBlocks',
			array(
				'variationIconCanBeObject' => self::can_variation_transform_icon_be_an_object(),
				'courseId'                 => self::get_course_id(),
			)
		);


Top ↑

Changelog Changelog

Changelog
Version Description
2.4.3 Added script localization.
2.3.0 Also load assets on site editor screen.
2.2.0 Only load assets on post screens.
2.0.0 Maybe load backwards compatibility script.
1.8.0 Update asset paths and improve script dependencies.
1.4.1 Fix double slash in asset path.
1.10.0 Use LLMS_Assets class methods for asset enqueues.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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