Forked from ryanlabelle/Elementor Add Control to Existing Widget
Created
February 14, 2022 08:00
-
-
Save emrahkan/1e079510e1d1bc38a60f8e1eea57ae25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add Image Stretch Option Control to the Image Gallery Widget */ | |
add_action( 'elementor/element/before_section_end', function( $element, $section_id, $args ) { | |
/** @var \Elementor\Element_Base $element */ | |
if ( 'image-gallery' === $element->get_name() && 'section_gallery' === $section_id ) { | |
$element->add_control( | |
'image_stretch', | |
[ | |
'label' => __( 'Image Stretch', 'elementor' ), | |
'type' => \Elementor\Controls_Manager::SELECT, | |
'default' => 'no', | |
'options' => [ | |
'no' => __( 'No', 'elementor' ), | |
'yes' => __( 'Yes', 'elementor' ), | |
], | |
] | |
); | |
} | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment