woocommerce/includes/class-wc-integrations.php

46 lines
897 B
PHP
Raw Normal View History

2012-04-30 19:50:35 +00:00
<?php
/**
* WooCommerce Integrations class
2012-08-15 18:15:06 +00:00
*
2012-04-30 19:50:35 +00:00
* Loads Integrations into WooCommerce.
*
2015-07-16 19:55:48 +00:00
* @class WC_Integrations
* @version 2.3.0
* @package WooCommerce/Classes/Integrations
* @category Class
* @author WooThemes
2012-04-30 19:50:35 +00:00
*/
class WC_Integrations {
2012-08-15 18:15:06 +00:00
2014-12-16 11:36:26 +00:00
/** Array of integration classes */
public $integrations = array();
2012-08-15 18:15:06 +00:00
2012-04-30 19:50:35 +00:00
/**
2015-07-16 19:55:48 +00:00
* Initialize integrations.
2012-04-30 19:50:35 +00:00
*/
public function __construct() {
2012-08-15 18:15:06 +00:00
do_action( 'woocommerce_integrations_init' );
2012-08-15 18:15:06 +00:00
$load_integrations = apply_filters( 'woocommerce_integrations', array() );
2012-08-15 18:15:06 +00:00
2012-04-30 19:50:35 +00:00
// Load integration classes
foreach ( $load_integrations as $integration ) {
2012-08-15 18:15:06 +00:00
2012-04-30 19:50:35 +00:00
$load_integration = new $integration();
2012-08-15 18:15:06 +00:00
$this->integrations[ $load_integration->id ] = $load_integration;
2012-04-30 19:50:35 +00:00
}
}
2012-08-15 18:15:06 +00:00
/**
* Return loaded integrations.
*
* @access public
* @return array
*/
public function get_integrations() {
2012-04-30 19:50:35 +00:00
return $this->integrations;
}
}