| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
class Routeapp_Plugin_Integrations { |
| 7 |
|
| 8 |
public static $plugin_integrations = array(); |
| 9 |
|
| 10 |
public static function setup() { |
| 11 |
$compatibilities_folder = [ 'tracking', 'checkout' ]; |
| 12 |
foreach ( $compatibilities_folder as $folder ) { |
| 13 |
foreach ( glob( plugin_dir_path( __FILE__ ) . '../integrations/' . $folder . '/*.php' ) as $filename ) { |
| 14 |
require_once( $filename ); |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
public static function register( $object, $slug ) { |
| 21 |
self::$plugin_integrations[ $slug ] = $object; |
| 22 |
} |
| 23 |
|
| 24 |
public static function get_compatibility_class( $slug ) { |
| 25 |
return ( isset( self::$plugin_integrations[ $slug ] ) ) ? self::$plugin_integrations[ $slug ] : false; |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
Routeapp_Plugin_Integrations::setup(); |