Created
September 13, 2019 00:16
-
-
Save JeffAspen/b5d5714021c0759ea1ac72e3374e432f to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Widget - Site Logo | |
* Extend Site Logo to create SVG control option with height | |
* | |
* | |
* @since 1.0.2 | |
* @access public | |
* | |
*/ | |
add_action( 'elementor/element/theme-site-logo/section_image/after_section_start', function( $element, $section_id ) { | |
$element->add_control( | |
'svg_logo', | |
[ | |
'label' => 'Is the logo a SVG?', | |
'type' => \Elementor\Controls_Manager::SWITCHER, | |
'description' => 'Site logo is located in Customizer > Header', | |
'label_on' => __( 'Yes', 'your-plugin' ), | |
'label_off' => __( 'No', 'your-plugin' ), | |
'return_value' => 'yes', | |
'default' => 'no', | |
] | |
); | |
$element->add_responsive_control( | |
'svg_logo_height', | |
[ | |
'label' => 'SVG Height', | |
'type' => \Elementor\Controls_Manager::TEXT, | |
'condition' => [ | |
'svg_logo' => 'yes', | |
], | |
'selectors' => [ | |
'{{WRAPPER}} .elementor-image img' => 'height: {{VALUE}}px', | |
], | |
] | |
); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment