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