API
2 years ago
Admin
2 years ago
Blocks
2 years ago
CLI
3 years ago
Container
2 years ago
Data
2 years ago
Integrations
2 years ago
REST
2 years ago
Theme
3 years ago
Tools
2 years ago
WP
2 years ago
Whatsit
2 years ago
Config_Handler.php
2 years ago
Integration.php
4 years ago
Permissions.php
2 years ago
Pod_Manager.php
2 years ago
Service_Provider.php
2 years ago
Service_Provider_Base.php
2 years ago
Static_Cache.php
4 years ago
Whatsit.php
2 years ago
Wisdom_Tracker.php
3 years ago
Service_Provider.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Pods; |
| 4 | |
| 5 | use PodsMeta; |
| 6 | |
| 7 | /** |
| 8 | * Class Service_Provider |
| 9 | * |
| 10 | * @since 2.8.0 |
| 11 | */ |
| 12 | class Service_Provider extends \Pods\Service_Provider_Base { |
| 13 | |
| 14 | /** |
| 15 | * Registers the classes and functionality needed. |
| 16 | * |
| 17 | * @since 2.8.0 |
| 18 | */ |
| 19 | public function register() { |
| 20 | $this->container->singleton( Config_Handler::class, Config_Handler::class ); |
| 21 | $this->container->singleton( Permissions::class, Permissions::class ); |
| 22 | $this->container->singleton( Pod_Manager::class, Pod_Manager::class ); |
| 23 | $this->container->singleton( Static_Cache::class, Static_Cache::class ); |
| 24 | |
| 25 | $this->container->bind( Data\Conditional_Logic::class, Data\Conditional_Logic::class ); |
| 26 | $this->container->singleton( Data\Map_Field_Values::class, Data\Map_Field_Values::class ); |
| 27 | |
| 28 | $this->container->singleton( Theme\WP_Query_Integration::class, Theme\WP_Query_Integration::class ); |
| 29 | |
| 30 | $this->container->singleton( Tools\Repair::class, Tools\Repair::class ); |
| 31 | $this->container->singleton( Tools\Reset::class, Tools\Reset::class ); |
| 32 | |
| 33 | $this->container->singleton( WP\Bindings::class, WP\Bindings::class ); |
| 34 | $this->container->singleton( WP\Meta::class, WP\Meta::class ); |
| 35 | $this->container->singleton( WP\Revisions::class, WP\Revisions::class ); |
| 36 | |
| 37 | $this->container->singleton( WP\UI\Taxonomy_Filter::class, WP\UI\Taxonomy_Filter::class ); |
| 38 | |
| 39 | $this->container->singleton( PodsMeta::class, PodsMeta::class ); |
| 40 | |
| 41 | $this->hooks(); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Hooks all the methods and actions the class needs. |
| 46 | * |
| 47 | * @since 2.8.0 |
| 48 | */ |
| 49 | protected function hooks() { |
| 50 | add_action( 'init', $this->container->callback( Theme\WP_Query_Integration::class, 'hook' ), 20 ); |
| 51 | |
| 52 | add_action( 'init', $this->container->callback( WP\Bindings::class, 'hook' ), 20 ); |
| 53 | add_action( 'init', $this->container->callback( WP\Revisions::class, 'hook' ), 20 ); |
| 54 | |
| 55 | add_action( 'init', $this->container->callback( WP\UI\Taxonomy_Filter::class, 'hook' ), 20 ); |
| 56 | } |
| 57 | } |
| 58 |