Skip to content

Commit

Permalink
Update group-control.md (#275)
Browse files Browse the repository at this point in the history
* Update group-control.md

Advanced Group Control Label Modify added

* Update group-control.md

* Apply suggestions from code review

---------

Co-authored-by: Rami Yushuvaev <92088692+rami-elementor@users.noreply.github.com>
  • Loading branch information
bdkoder and rami-elementor authored Dec 23, 2024
1 parent 72580d9 commit 7105bdc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/editor-controls/group-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,41 @@ class Elementor_Test_Widget extends \Elementor\Widget_Base {

}
```

### Group Control Label Modify

Here's an advanced setup for changing the background control label.

```php {13-25}
class Elementor_Test_Widget extends \Elementor\Widget_Base {

protected function register_controls() {

$this->start_controls_section(
'style_section',
[
'label' => esc_html__( 'Style', 'textdomain' ),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);

$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'control_name',
'label' => esc_html__( 'Background', 'textdomain' ),
'types' => [ 'classic', 'gradient', 'video' ],
'fields_options' => [
'background' => [
'label' => esc_html__( 'New Label Here...', 'textdomain' ),
],
],
]
);

$this->end_controls_section();

}

}
```

0 comments on commit 7105bdc

Please sign in to comment.