Hooks::enqueue_widget_admin_assets( $slug )


Source

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

	public function enqueue_widget_admin_assets( $slug ) {
		if ( is_admin() && get_current_screen()->is_block_editor ) {
			tribe_asset_enqueue( 'tribe-select2' );
			tribe_asset_enqueue( 'tribe-admin-widget' );
		}

		$widgets_manager = tribe( \Tribe\Widget\Manager::class );
		$widgets         = $widgets_manager->get_registered_widgets();

		if ( empty( $widgets[ $slug ] ) ) {
			return;
		}

		tribe_asset_enqueue( 'tribe-select2' );
		tribe_asset_enqueue( 'tribe-admin-widget' );
	}