Skip to content

Instantly share code, notes, and snippets.

@hmbashar
Last active November 13, 2023 12:24
Show Gist options
  • Save hmbashar/938df2ebe91afb170a5dfb08b0c635b3 to your computer and use it in GitHub Desktop.
Save hmbashar/938df2ebe91afb170a5dfb08b0c635b3 to your computer and use it in GitHub Desktop.
Best way to add control for existing widgets
<?php
// add color control for tab tringle
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) {
if( $section->get_name() == 'nested-tabs' && $section_id == 'section_tabs_style' ){
$section->add_control(
'abc-tab-tringle-color' ,
[
'label' => 'Traingle Color',
'type' => Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}}.abc-var-tabs .e-n-tabs-heading > button[aria-selected="true"]:after' => 'border-left-color: {{VALUE}}',
],
'prefix_class' => 'abc-tab-tringle-color-',
]
);
}
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment