Completed
Branch master (8d1f99)
by
unknown
01:57
created

Auto_Load_Next_Post_Integrations   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
A get_integrations() 0 3 1
1
<?php
2
/**
3
 * Auto Load Next Post Integrations class
4
 *
5
 * Loads Integrations into Auto Load Next Post.
6
 *
7
 * @version  1.6.0
8
 * @author   Sébastien Dumont
9
 * @category Classes
10
 * @package  Auto Load Next Post/Classes/Integrations
11
 * @license  GPL-2.0+
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
if ( ! class_exists( 'Auto_Load_Next_Post_Integrations' ) ) {
20
21
	class Auto_Load_Next_Post_Integrations {
22
23
		/**
24
		 * Array of integrations.
25
		 *
26
		 * @access public
27
		 * @var   array
28
		 */
29
		public $integrations = array();
30
31
		/**
32
		 * Initialize integrations.
33
		 *
34
		 * @access public
35
		 */
36
		public function __construct() {
37
			do_action( 'auto_load_next_post_integrations_init' );
38
39
			$load_integrations = apply_filters( 'auto_load_next_post_integrations', array() );
40
41
			// Load integration classes.
42
			foreach ( $load_integrations as $integration ) {
43
				$load_integration = new $integration();
44
45
				$this->integrations[ $load_integration->id ] = $load_integration;
46
			}
47
		} // END __construct()
48
49
		/**
50
		 * Return loaded integrations.
51
		 *
52
		 * @access public
53
		 * @return array
54
		 */
55
		public function get_integrations() {
56
			return $this->integrations;
57
		} // END get_integrations()
58
59
	} // END class
60
61
} // END if class
62