Created
February 8, 2021 12:07
-
-
Save Zodiac1978/a80c47d253109df30952bef045385280 to your computer and use it in GitHub Desktop.
Remove divi shortcodes from attached pages in Germanized for Woocommerce plugin mails
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
<?php | |
/** | |
* Just return the content | |
* | |
* @param [string] $atts Unused attributes. | |
* @param [string] $content Submitted content. | |
* @return [string] Unmodified content with shortcodes because of nested shortcodes. | |
*/ | |
function divi_remove_shortcodes( $atts, $content ) { | |
return do_shortcode( $content ); | |
} | |
/** | |
* Unregisters divi shortcodes and re-adds with only content. | |
*/ | |
function my_child_remove_custom_shortcodes() { | |
remove_shortcode( 'et_pb_section' ); | |
remove_shortcode( 'et_pb_row' ); | |
remove_shortcode( 'et_pb_column' ); | |
remove_shortcode( 'et_pb_text' ); | |
add_shortcode( 'et_pb_section', 'divi_remove_shortcodes' ); | |
add_shortcode( 'et_pb_row', 'divi_remove_shortcodes' ); | |
add_shortcode( 'et_pb_column', 'divi_remove_shortcodes' ); | |
add_shortcode( 'et_pb_text', 'divi_remove_shortcodes' ); | |
} | |
add_action( 'woocommerce_germanized_attach_email_footer', 'my_child_remove_custom_shortcodes', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment