【问题标题】:I ma trying to use Elementor Typography Control. But It's not working我正在尝试使用 Elementor Typography Control。但它不起作用
【发布时间】:2020-04-30 21:53:08
【问题描述】:

现在我正在使用 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**

【问题讨论】:

    标签: php wordpress error-handling xampp


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      use Elementor\Scheme_Typography;
      

      我是在打开 PHP 错误报告后发现的。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-11-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-28
        • 2015-07-18
        相关资源
        最近更新 更多