| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* Container for 3rd party plugins ( and themes ) integrations. |
| 8 |
* This class is available as soon as the plugin is loaded. |
| 9 |
* |
| 10 |
* @since 1.0 |
| 11 |
* @since 2.8 Renamed from PLL_Plugins_Compat to PLL_Integrations. |
| 12 |
*/ |
| 13 |
class PLL_Integrations { |
| 14 |
/** |
| 15 |
* Singleton instance. |
| 16 |
* |
| 17 |
* @var PLL_Integrations |
| 18 |
*/ |
| 19 |
protected static $instance; |
| 20 |
|
| 21 |
/** |
| 22 |
* Constructor. |
| 23 |
* |
| 24 |
* @since 1.0 |
| 25 |
*/ |
| 26 |
protected function __construct() { |
| 27 |
// Loads external integrations. |
| 28 |
foreach ( glob( __DIR__ . '/*/load.php', GLOB_NOSORT ) as $load_script ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 29 |
require_once $load_script; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Access to the single instance of the class. |
| 35 |
* |
| 36 |
* @since 1.7 |
| 37 |
* |
| 38 |
* @return PLL_Integrations |
| 39 |
*/ |
| 40 |
public static function instance() { |
| 41 |
if ( empty( self::$instance ) ) { |
| 42 |
self::$instance = new self(); |
| 43 |
} |
| 44 |
|
| 45 |
return self::$instance; |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
class_alias( 'PLL_Integrations', 'PLL_Plugins_Compat' ); // For Backward compatibility. |
| 50 |
|