PluginProbe
Pods – Custom Content Types and Fields / 3.3.9
Pods – Custom Content Types and Fields v3.3.9
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 / src / Pods / Integrations / WPGraphQL / Service_Provider.php
Service_Provider.php
58 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Pods\Integrations\WPGraphQL;
4
5 // Don't load directly.
6 if ( ! defined( 'ABSPATH' ) ) {
7 die( '-1' );
8 }
9
10 /**
11 * Class Service_Provider
12 *
13 * @since 2.9.0
14 */
15 class Service_Provider extends \Pods\Service_Provider_Base {
16
17 /**
18 * Registers the classes and functionality needed.
19 *
20 * @since 2.9.0
21 */
22 public function register() {
23 $this->container->singleton( Integration::class, Integration::class );
24 $this->container->singleton( Settings::class, Settings::class );
25
26 $this->hooks();
27 }
28
29 /**
30 * Hooks all the methods and actions the class needs.
31 *
32 * @since 2.9.0
33 */
34 protected function hooks() {
35 add_action( 'init', [ $this, 'hook_init' ] );
36 }
37
38 public function hook_init() {
39 $integration = pods_container( Integration::class );
40
41 $requirements = $integration->get_requirements();
42
43 $pods_admin = pods_admin();
44
45 // Only hook into the integration if the requirements are met.
46 if ( ! $pods_admin->check_requirements( $requirements ) ) {
47 return;
48 }
49
50 $integration->hook();
51
52 // Get the Settings instance and register the settings.
53 $settings = pods_container( Settings::class );
54
55 $settings->hook();
56 }
57 }
58