| 1 |
<?php |
| 2 |
|
| 3 |
namespace MasterAddons\Inc\Classes; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
/** |
| 8 |
* Elementor Backward Compatibility |
| 9 |
* |
| 10 |
* Registers stub classes for deprecated Elementor Scheme_Color and Scheme_Typography |
| 11 |
* that were removed in Elementor 3.15+. Prevents fatal errors from third-party |
| 12 |
* themes/plugins (e.g. Brooklyn Lite) that still reference them. |
| 13 |
*/ |
| 14 |
class Elementor_Compat { |
| 15 |
|
| 16 |
/** |
| 17 |
* Register deprecated Elementor class stubs if missing. |
| 18 |
*/ |
| 19 |
public static function init() { |
| 20 |
// Scheme_Color |
| 21 |
if ( ! class_exists( '\Elementor\Scheme_Color' ) ) { |
| 22 |
if ( class_exists( '\Elementor\Core\Schemes\Color' ) ) { |
| 23 |
class_alias( '\Elementor\Core\Schemes\Color', '\Elementor\Scheme_Color' ); |
| 24 |
} else { |
| 25 |
class_alias( __NAMESPACE__ . '\Elementor_Scheme_Color_Stub', '\Elementor\Scheme_Color' ); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
// Scheme_Typography |
| 30 |
if ( ! class_exists( '\Elementor\Scheme_Typography' ) ) { |
| 31 |
if ( class_exists( '\Elementor\Core\Schemes\Typography' ) ) { |
| 32 |
class_alias( '\Elementor\Core\Schemes\Typography', '\Elementor\Scheme_Typography' ); |
| 33 |
} else { |
| 34 |
class_alias( __NAMESPACE__ . '\Elementor_Scheme_Typography_Stub', '\Elementor\Scheme_Typography' ); |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Minimal stub for Elementor\Scheme_Color (removed in Elementor 3.15+). |
| 42 |
* |
| 43 |
* @internal |
| 44 |
*/ |
| 45 |
class Elementor_Scheme_Color_Stub { |
| 46 |
const COLOR_1 = '1'; |
| 47 |
const COLOR_2 = '2'; |
| 48 |
const COLOR_3 = '3'; |
| 49 |
const COLOR_4 = '4'; |
| 50 |
|
| 51 |
public static function get_type() { |
| 52 |
return 'color'; |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* Minimal stub for Elementor\Scheme_Typography (removed in Elementor 3.15+). |
| 58 |
* |
| 59 |
* @internal |
| 60 |
*/ |
| 61 |
class Elementor_Scheme_Typography_Stub { |
| 62 |
const TYPOGRAPHY_1 = '1'; |
| 63 |
const TYPOGRAPHY_2 = '2'; |
| 64 |
const TYPOGRAPHY_3 = '3'; |
| 65 |
const TYPOGRAPHY_4 = '4'; |
| 66 |
|
| 67 |
public static function get_type() { |
| 68 |
return 'typography'; |
| 69 |
} |
| 70 |
} |
| 71 |
|