-
-
Save dexit/ce0174045bbfeda4703564e5bb14553b to your computer and use it in GitHub Desktop.
Add disclaimer notice after all Elementor HTML widgets that use id 'html_notice'
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
<?php | |
add_action( 'elementor/widget/render_content', function( $content, $widget ) { | |
if ( 'html' === $widget->get_name() ) { | |
$settings = $widget->get_settings(); //contains all widget settings - read-only! | |
//checks if special id exists | |
if ( ! empty( $settings['_element_id'] ) && $settings['_element_id'] === 'html_notice' ) { | |
$content .= '<div class="disclaimer_notice"><span>Copy and use of the above code is at your own risk.</span></div>'; | |
} | |
} | |
return $content; | |
}, 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment