PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.2.2
Pods – Custom Content Types and Fields v3.2.2
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 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / src / Pods / Integrations / WPGraphQL / Service_Provider.php
pods / src / Pods / Integrations / WPGraphQL Last commit date
Connection_Resolver 3 years ago Connection.php 3 years ago Field.php 3 years ago Integration.php 3 years ago Service_Provider.php 3 years ago Settings.php 3 years ago
Service_Provider.php
53 lines
1 <?php
2
3 namespace Pods\Integrations\WPGraphQL;
4
5 /**
6 * Class Service_Provider
7 *
8 * @since 2.9.0
9 */
10 class Service_Provider extends \Pods\Service_Provider_Base {
11
12 /**
13 * Registers the classes and functionality needed.
14 *
15 * @since 2.9.0
16 */
17 public function register() {
18 $this->container->singleton( Integration::class, Integration::class );
19 $this->container->singleton( Settings::class, Settings::class );
20
21 $this->hooks();
22 }
23
24 /**
25 * Hooks all the methods and actions the class needs.
26 *
27 * @since 2.9.0
28 */
29 protected function hooks() {
30 add_action( 'init', [ $this, 'hook_init' ] );
31 }
32
33 public function hook_init() {
34 $integration = pods_container( Integration::class );
35
36 $requirements = $integration->get_requirements();
37
38 $pods_admin = pods_admin();
39
40 // Only hook into the integration if the requirements are met.
41 if ( ! $pods_admin->check_requirements( $requirements ) ) {
42 return;
43 }
44
45 $integration->hook();
46
47 // Get the Settings instance and register the settings.
48 $settings = pods_container( Settings::class );
49
50 $settings->hook();
51 }
52 }
53