Skip to content

Commit bb1b0b3

Browse files
committed
[ButtonGroup] Added alignment control
1 parent 424ced3 commit bb1b0b3

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

widgets/buttongroup.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,33 @@ protected function _register_controls() {
401401
],
402402
]
403403
);
404+
405+
$this->add_control(
406+
'buttongroup_btns_align',
407+
[
408+
'label' => __( 'Alignment', 'mighty' ),
409+
'type' => \Elementor\Controls_Manager::CHOOSE,
410+
'options' => [
411+
'left' => [
412+
'title' => __( 'Left', 'mighty' ),
413+
'icon' => 'fa fa-align-left',
414+
],
415+
'center' => [
416+
'title' => __( 'Center', 'mighty' ),
417+
'icon' => 'fa fa-align-center',
418+
],
419+
'right' => [
420+
'title' => __( 'Right', 'mighty' ),
421+
'icon' => 'fa fa-align-right',
422+
],
423+
'justify' => [
424+
'title' => __( 'Justify', 'mighty' ),
425+
'icon' => 'fa fa-align-justify',
426+
]
427+
],
428+
'default' => 'center',
429+
]
430+
);
404431

405432
$this->end_controls_section();
406433
}
@@ -412,7 +439,7 @@ protected function render() {
412439
return;
413440
}
414441

415-
echo '<div class="mighty-buttongroup">';
442+
echo '<div class="mighty-buttongroup mt-btng-align-'. $settings['buttongroup_btns_align'] .'">';
416443

417444
foreach ( $settings['mt_buttongroup_btns'] as $btngrp ) :
418445

0 commit comments

Comments
 (0)