【发布时间】:2022-08-04 00:44:45
【问题描述】:
我需要对 Elementor 自定义小部件进行 3 个背景组控制。所以,我正在使用这个:
$this->add_group_control(
\\Elementor\\Group_Control_Background::get_type(),
[
\'name\' => \'background_active\',
\'label\' => esc_html__( \'Background Active\', \'plugin-name\' ),
\'types\' => [ \'classic\', \'gradient\', \'video\' ],
\'selector\' => \'{{WRAPPER}} .navigate-master ul li a.active\',
\'default\' => esc_html__( \'#ffb200\' , \'plugin-name\' ),
\'condition\' => [
\'nm_nm_title\' => \'\',
],
]
);
$this->add_group_control(
\\Elementor\\Group_Control_Background::get_type(),
[
\'name\' => \'background\',
\'label\' => esc_html__( \'Background\', \'plugin-name\' ),
\'types\' => [ \'classic\', \'gradient\', \'video\' ],
\'selector\' => \'{{WRAPPER}} .navigate-master ul li a\',
\'default\' => esc_html__( \'#ffb200\' , \'plugin-name\' ),
\'condition\' => [
\'nm_nm_title\' => \'\',
],
]
);
$this->add_group_control(
\\Elementor\\Group_Control_Background::get_type(),
[
\'name\' => \'background_hover\',
\'label\' => esc_html__( \'Background Hover\', \'plugin-name\' ),
\'types\' => [ \'classic\', \'gradient\', \'video\' ],
\'selector\' => \'{{WRAPPER}} .navigate-master ul li a:hover\',
\'default\' => esc_html__( \'yellow\' , \'plugin-name\' ),
\'condition\' => [
\'nm_nm_title\' => \'\',
],
]
);
您可以看到我使用了唯一的名称和标签,但在小部件侧边栏上看不到不同的标签。
你能告诉我为什么吗?
标签: elementor