Skip to content

Instantly share code, notes, and snippets.

@kaskad88
Last active November 4, 2019 14:54
Show Gist options
  • Save kaskad88/74d5760c96c0520c2763d8dd01125069 to your computer and use it in GitHub Desktop.
Save kaskad88/74d5760c96c0520c2763d8dd01125069 to your computer and use it in GitHub Desktop.
HDquiz & JetPopup compatibility
add_action( 'elementor/widget/before_render_content', function( $widget ) {
if ( 'shortcode' !== $widget->get_name() ) {
return;
}
if ( false === strpos( $widget->get_settings_for_display( 'shortcode' ), '[HDquiz quiz' ) ) {
return;
}
Elementor\Plugin::instance()->frontend->remove_content_filter();
} );
add_filter( 'elementor/widget/render_content', function ( $content, $widget ) {
if ( 'shortcode' !== $widget->get_name() ) {
return $content;
}
if ( false === strpos( $widget->get_settings_for_display( 'shortcode' ), '[HDquiz quiz' ) ) {
return $content;
}
Elementor\Plugin::instance()->frontend->add_content_filter();
return $content;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment