PluginProbe
Pods – Custom Content Types and Fields / 2.8.23.5
Pods – Custom Content Types and Fields v2.8.23.5
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 All 42 releases
pods / tribe-common / src / Tribe / Editor / Provider.php
Provider.php
68 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Tribe__Editor__Provider extends tad_DI52_ServiceProvider {
4
5 /**
6 * Binds and sets up implementations.
7 *
8 * @since 4.8
9 *
10 */
11 public function register() {
12 // Setup to check if gutenberg is active
13 $this->container->singleton( 'editor', 'Tribe__Editor' );
14 $this->container->singleton( 'editor.utils', 'Tribe__Editor__Utils' );
15 $this->container->singleton( 'common.editor.configuration', 'Tribe__Editor__Configuration' );
16
17 if ( ! tribe( 'editor' )->should_load_blocks() ) {
18 return;
19 }
20
21 $this->container->singleton( 'editor.assets', 'Tribe__Editor__Assets', [ 'hook' ] );
22
23 $this->hook();
24
25 // Initialize the correct Singletons
26 tribe( 'editor.assets' );
27 }
28
29 /**
30 * Any hooking any class needs happen here.
31 *
32 * In place of delegating the hooking responsibility to the single classes they are all hooked here.
33 *
34 * @since 4.8
35 *
36 */
37 protected function hook() {
38 // Setup the registration of Blocks
39 add_action( 'init', [ $this, 'register_blocks' ], 20 );
40 }
41
42 /**
43 * Prevents us from using `init` to register our own blocks, allows us to move
44 * it when the proper place shows up
45 *
46 * @since 4.8.2
47 *
48 * @return void
49 */
50 public function register_blocks() {
51 /**
52 * Internal Action used to register blocks for Events
53 *
54 * @since 4.8.2
55 */
56 do_action( 'tribe_editor_register_blocks' );
57 }
58
59 /**
60 * Binds and sets up implementations at boot time.
61 *
62 * @since 4.8
63 */
64 public function boot() {
65 // no ops
66 }
67 }
68