我想使用 Elementor Typography Control。但它不工作

I ma trying to use Elementor Typography Control. But It's not working

现在我正在使用 This For Elementor Control。 我尝试了将近 10 次,但没有用。 有人请帮助我。我不明白为什么它不起作用。其他控件工作正常。都准备好了。只有排版控件不起作用。


        //slide control
        $this->start_controls_section(
            'hero_area_section',
            [
                'label' => __( 'Content', 'plugin-name' ),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

$this->add_control(
        'bg', [
            'label' => __( 'Background', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::MEDIA,
            'label_block' => true,
        ]
    );
  $this->add_control(
        'title', [
            'label' => __( 'Title', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::TEXTAREA,
            'label_block' => true,
        ]
    );
   $this->add_control(
        'cap', [
            'label' => __( 'Caption', 'plugin-domain' ),
            'type' => \Elementor\Controls_Manager::TEXTAREA,
            'label_block' => true,
        ]
    );

  $this->add_group_control(
    Group_Control_Typography::get_type(),
    [
        'name' => 'title_typography',
        'label' => __( 'Title Typography', 'my-plugin-domain' ),
        'scheme' => Scheme_Typography::TYPOGRAPHY_1,
        'selector' => '{{WRAPPER}} h3',

    ]
);

$this->end_controls_section();```



And this is not working and showing this Erro:

**Fatal error: Uncaught Error: Class 'Group_Control_Typography' not found in C:\xampp\htdocs\kaye\wp-content\plugins\toolkit\widgets\hero_area.php:66 Stack trace: #0 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1900): rrfCommercew_hero_area->_register_controls() #1 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(487): Elementor\Controls_Stack->init_controls() #2 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\widget-base.php(148): Elementor\Controls_Stack->get_stack() #3 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(280): Elementor\Widget_Base->get_stack() #4 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1935): Elementor\Controls_Stack->get_controls() #5 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\controls-stack.php(1022): Elementor\Controls_Stack->sanitize_settings(Array) #6 C:\xampp\htdocs\kaye\wp-content\plugins\elementor\includes\base\eleme in C:\xampp\htdocs\kaye\wp-content\plugins\toolkit\widgets\hero_area.php on line 66**

Group_Control_Typography 之前使用 \Elementor\ 就像您在其他部分所做的那样。

对我来说,我需要在文件顶部添加以下内容:

use Elementor\Scheme_Typography;

我在打开 PHP 错误报告后发现了这个。

这样使用,

        $this->add_group_control(
   \Elementor\Group_Control_Typography::get_type(),
     [
         'name' => 'content_typography',
     'selector' => '{{WRAPPER}} .santha_widget_layout',
    ]
);

Scheme_Typography 已弃用。使用 \Elementor\Core\Schemes\Typography 代替

https://forum.elementor.com/development-24/deprecated-elementor-scheme-typography-solved-sure-9919