Reputation: 33
I have written this code( Please take a look at below), But it show this error """"
Fatal error: Uncaught Error: Class 'Elementor\Global_Typography' not found in E:\xampp\htdocs\plugin\wp-content\plugins\Test Plugin\widgets\test-widget.php:126 Stack trace: #0 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\controls-stack.php(1951): ETPWidget->_register_controls() #1 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\controls-stack.php(488): Elementor\Controls_Stack->init_controls() #2 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\widget-base.php(148): Elementor\Controls_Stack->get_stack() #3 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\controls-stack.php(294): Elementor\Widget_Base->get_stack() #4 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\controls-stack.php(2040): Elementor\Controls_Stack->get_controls() #5 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includes\base\controls-stack.php(1012): Elementor\Controls_Stack->sanitize_settings(Array) #6 E:\xampp\htdocs\plugin\wp-content\plugins\elementor\includ in E:\xampp\htdocs\plugin\wp-content\plugins\Test Plugin\widgets\test-widget.php on line 126
""
$this->add_control( 'title_color', [ 'label' => __( 'Title Color', 'etpaddons' ), 'type' => \Elementor\Controls_Manager::COLOR, 'scheme' => [ 'type' => \Elementor\Scheme_Color::get_type(), 'value' => \Elementor\Scheme_Color::COLOR_1, ], 'global' => [ 'default' => \Elementor\Global_Color::COLOR_PRIMARY, ], 'selectors' => [ '{{WRAPPER}} .etpaddons-heading' => 'color: {{VALUE}}', ], ] );
Upvotes: 0
Views: 859
Reputation: 11
You have to import those namespaces first
use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
Upvotes: 1