| 1 |
<?php |
| 2 |
namespace Elementor\Core\Settings\General; |
| 3 |
|
| 4 |
use Elementor\Core\Files\CSS\Base; |
| 5 |
use Elementor\Core\Settings\Base\CSS_Manager; |
| 6 |
use Elementor\Core\Settings\Base\Model as BaseModel; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* This class is deprecated, use Plugin::$instance->kits_manager->get_active_kit_for_frontend() instead. |
| 14 |
* it changed to support call like this: Manager::get_settings_managers( 'general' )->get_model()->get_settings( 'elementor_default_generic_fonts' ) |
| 15 |
* |
| 16 |
* @deprecated 3.0.0 Use `Plugin::$instance->kits_manager->get_active_kit_for_frontend()` instead. |
| 17 |
*/ |
| 18 |
class Manager extends CSS_Manager { |
| 19 |
|
| 20 |
/** |
| 21 |
* Meta key for the general settings. |
| 22 |
* |
| 23 |
* @deprecated 3.0.0 |
| 24 |
*/ |
| 25 |
const META_KEY = '_elementor_general_settings'; |
| 26 |
|
| 27 |
/** |
| 28 |
* General settings manager constructor. |
| 29 |
* |
| 30 |
* Initializing Elementor general settings manager. |
| 31 |
* |
| 32 |
* @since 1.6.0 |
| 33 |
* @deprecated 3.0.0 |
| 34 |
* @access public |
| 35 |
*/ |
| 36 |
public function __construct() { |
| 37 |
parent::__construct(); |
| 38 |
|
| 39 |
_deprecated_file( __FILE__, '3.0.0', 'Plugin::$instance->kits_manager->get_active_kit_for_frontend()' ); |
| 40 |
|
| 41 |
$name = $this->get_css_file_name(); |
| 42 |
|
| 43 |
remove_action( "elementor/css-file/{$name}/parse", [ $this, 'add_settings_css_rules' ] ); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Get manager name. |
| 48 |
* |
| 49 |
* Retrieve general settings manager name. |
| 50 |
* |
| 51 |
* @since 1.6.0 |
| 52 |
* @deprecated 3.0.0 |
| 53 |
* @access public |
| 54 |
* |
| 55 |
* @return string Manager name. |
| 56 |
*/ |
| 57 |
public function get_name() { |
| 58 |
return 'general'; |
| 59 |
} |
| 60 |
|
| 61 |
/** |
| 62 |
* Get model for config. |
| 63 |
* |
| 64 |
* Retrieve the model for settings configuration. |
| 65 |
* |
| 66 |
* @since 1.6.0 |
| 67 |
* @deprecated 3.0.0 |
| 68 |
* @access public |
| 69 |
* |
| 70 |
* @return BaseModel The model object. |
| 71 |
*/ |
| 72 |
public function get_model_for_config() { |
| 73 |
return $this->get_model(); |
| 74 |
} |
| 75 |
|
| 76 |
/** |
| 77 |
* @deprecated 3.0.0 |
| 78 |
*/ |
| 79 |
protected function get_saved_settings( $id ) { |
| 80 |
return []; |
| 81 |
} |
| 82 |
|
| 83 |
/** |
| 84 |
* Get CSS file name. |
| 85 |
* |
| 86 |
* Retrieve CSS file name for the general settings manager. |
| 87 |
* |
| 88 |
* @since 1.6.0 |
| 89 |
* @deprecated 3.0.0 |
| 90 |
* @access protected |
| 91 |
* |
| 92 |
* @return string CSS file name. |
| 93 |
*/ |
| 94 |
protected function get_css_file_name() { |
| 95 |
return 'global'; |
| 96 |
} |
| 97 |
|
| 98 |
/** |
| 99 |
* @deprecated 3.0.0 |
| 100 |
* |
| 101 |
* @throws \Exception If settings validation fails or update operation encounters errors. |
| 102 |
*/ |
| 103 |
protected function save_settings_to_db( array $settings, $id ) { |
| 104 |
throw new \Exception( __CLASS__ . ' is deprecated. Use Plugin::$instance->kits_manager->get_active_kit_for_frontend() instead.' ); |
| 105 |
} |
| 106 |
|
| 107 |
/** |
| 108 |
* @deprecated 3.0.0 |
| 109 |
*/ |
| 110 |
protected function get_model_for_css_file( Base $css_file ) { |
| 111 |
return false; |
| 112 |
} |
| 113 |
|
| 114 |
/** |
| 115 |
* @deprecated 3.0.0 |
| 116 |
*/ |
| 117 |
protected function get_css_file_for_update( $id ) { |
| 118 |
return false; |
| 119 |
} |
| 120 |
} |
| 121 |
|