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.
|
|
|
|
*
|
|
|
|
* @class WC_Integrations
|
2012-12-31 18:25:09 +00:00
|
|
|
* @version 2.0.0
|
2012-08-15 18:15:06 +00:00
|
|
|
* @package WooCommerce/Classes/Integrations
|
2013-02-20 17:14:46 +00:00
|
|
|
* @category Class
|
2012-08-15 18:15:06 +00:00
|
|
|
* @author WooThemes
|
2012-04-30 19:50:35 +00:00
|
|
|
*/
|
|
|
|
class WC_Integrations {
|
2012-08-15 18:15:06 +00:00
|
|
|
|
|
|
|
/** @var array Array of integration classes */
|
2012-04-30 19:50:35 +00:00
|
|
|
var $integrations = array();
|
2012-08-15 18:15:06 +00:00
|
|
|
|
2012-04-30 19:50:35 +00:00
|
|
|
/**
|
2012-12-31 18:25:09 +00:00
|
|
|
* __construct function.
|
2012-08-15 18:15:06 +00:00
|
|
|
*
|
2012-04-30 19:50:35 +00:00
|
|
|
* @access public
|
2012-08-15 18:15:06 +00:00
|
|
|
* @return void
|
2012-04-30 19:50:35 +00:00
|
|
|
*/
|
2012-12-31 18:25:09 +00:00
|
|
|
public function __construct() {
|
2012-08-15 18:15:06 +00:00
|
|
|
|
2012-12-31 18:25:09 +00:00
|
|
|
do_action( 'woocommerce_integrations_init' );
|
2012-08-15 18:15:06 +00:00
|
|
|
|
2012-12-31 18:25:09 +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
|
|
|
|
2013-09-26 16:01:29 +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
|
|
|
|
2012-04-30 19:50:35 +00:00
|
|
|
}
|
2012-08-15 18:15:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return loaded integrations.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return array
|
|
|
|
*/
|
2012-12-31 18:25:09 +00:00
|
|
|
public function get_integrations() {
|
2012-04-30 19:50:35 +00:00
|
|
|
return $this->integrations;
|
|
|
|
}
|
2013-11-01 16:39:33 +00:00
|
|
|
}
|