Controller::register_for_blocks()
Handle registration for blocks-functionality separately.
Source
File: src/Tickets/Blocks/Controller.php
public function register_for_blocks() {
/** @var \Tribe__Editor $editor */
$editor = tribe( 'editor' );
$this->container->singleton(
'tickets.editor.compatibility.tickets',
'Tribe__Tickets__Editor__Compatibility__Tickets',
[ 'hook' ]
);
$this->container->singleton( 'tickets.editor.assets', Assets::class, [ 'register' ] );
$this->container->singleton( 'tickets.editor.meta', Meta::class );
$this->container->singleton( 'tickets.editor.rest.compatibility', REST_Compatibility::class, [ 'hook' ] );
$this->container->singleton( 'tickets.editor.attendees_table', Attendees_Table::class );
$this->hook();
/**
* Lets load all compatibility related methods
*
* @todo remove once RSVP and tickets blocks are completed
*/
$this->load_compatibility_tickets();
// Only register for blocks if we are using them.
if ( ! $editor->should_load_blocks() ) {
return;
}
// Initialize the correct Singleton.
tribe( 'tickets.editor.assets' );
tribe( 'tickets.editor.configuration' );
tribe( 'tickets.editor.template.overwrite' )->hook();
}
Changelog
| Version | Description |
|---|---|
| 5.0.4 | Introduced. |