| 1 |
<?php |
| 2 |
/** |
| 3 |
* Theme Compatibility |
| 4 |
* |
| 5 |
* @package |
| 6 |
*/ |
| 7 |
namespace WPFunnels\Compatibility\Theme; |
| 8 |
|
| 9 |
use WPFunnels\Wpfnl_functions; |
| 10 |
use WPFunnels\Traits\SingletonTrait; |
| 11 |
|
| 12 |
|
| 13 |
class Wpfnl_Theme_Compatibility { |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* Init all supported theme class |
| 18 |
* |
| 19 |
*/ |
| 20 |
public function init_classes(){ |
| 21 |
$themes = $this->get_all_compatible_themes(); |
| 22 |
if( is_array( $themes ) ){ |
| 23 |
foreach( $themes as $theme ){ |
| 24 |
if( isset( $theme['class_name'] ) ){ |
| 25 |
$class_name = "WPFunnels\\Compatibility\\Theme\\".$theme['class_name']; |
| 26 |
if (class_exists(ucfirst($class_name))) { |
| 27 |
$class_name::getInstance()->init(); |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
/** |
| 37 |
* Compatible themes |
| 38 |
*/ |
| 39 |
public function get_all_compatible_themes(){ |
| 40 |
$themes = [ |
| 41 |
[ |
| 42 |
'name' => 'Flatsome', |
| 43 |
'class_name' => 'Wpfnl_Flatsome_Compatibility' |
| 44 |
], |
| 45 |
[ |
| 46 |
'name' => 'TwentyTwentyTwo', |
| 47 |
'class_name' => 'Wpfnl_Twenty_Twenty_Two_Compatibility' |
| 48 |
], |
| 49 |
[ |
| 50 |
'name' => 'TwentyTwentyThree', |
| 51 |
'class_name' => 'Wpfnl_Twenty_Twenty_Three_Compatibility' |
| 52 |
], |
| 53 |
]; |
| 54 |
return $themes; |
| 55 |
} |
| 56 |
} |