class-wc-integrations.php 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * WooCommerce Integrations class
  4. *
  5. * Loads Integrations into WooCommerce.
  6. *
  7. * @version 2.3.0
  8. * @package WooCommerce/Classes/Integrations
  9. */
  10. defined( 'ABSPATH' ) || exit;
  11. /**
  12. * Integrations class.
  13. */
  14. class WC_Integrations {
  15. /**
  16. * Array of integrations.
  17. *
  18. * @var array
  19. */
  20. public $integrations = array();
  21. /**
  22. * Initialize integrations.
  23. */
  24. public function __construct() {
  25. do_action( 'woocommerce_integrations_init' );
  26. $load_integrations = apply_filters( 'woocommerce_integrations', array() );
  27. // Load integration classes.
  28. foreach ( $load_integrations as $integration ) {
  29. $load_integration = new $integration();
  30. $this->integrations[ $load_integration->id ] = $load_integration;
  31. }
  32. }
  33. /**
  34. * Return loaded integrations.
  35. *
  36. * @return array
  37. */
  38. public function get_integrations() {
  39. return $this->integrations;
  40. }
  41. }