Hooks::enqueue_customizer_in_block_editor()

Enqueue Customizer styles for the single event block editor screen.


Source #

File: src/Tribe/Views/V2/Hooks.php

	public function enqueue_customizer_in_block_editor() {
		// Make sure we're on the block edit screen
		if ( ! is_admin() || ! get_current_screen()->is_block_editor ) {
			return;
		}

		if ( ! tribe( 'admin.helpers' )->is_post_type_screen() ) {
			return;
		}

		global $post;
		// Make sure we're editing an Event post.
		if ( empty( $post ) || ! $post instanceof WP_Post || ! tribe_is_event( $post ) ) {
			return;
		}

		// Append the customizer styles to the single block stylesheet
		add_filter( 'tribe_customizer_inline_stylesheets', static function( $sheets ) {
			$sheets[] = 'tribe-admin-v2-single-blocks';

			return $sheets;
		} );

		// Print the styles!
		tribe( 'customizer' )->inline_style( true );
	}

Top ↑

Changelog #

Changelog
Version Description
5.14.1 Introduced.