Created
June 14, 2022 21:01
-
-
Save kimcoleman/c92205ef6597e8532ae1588b11f660a1 to your computer and use it in GitHub Desktop.
Allow shortcodes in the WooCommerce Store Notice.
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 | |
/** | |
* Allow shortcodes in the WooCommerce Store Notice. | |
*/ | |
function modify_woocommerce_demo_store_notice_allow_shortcodes( $notice_html, $notice ) { | |
$notice_html = '<div class="woocommerce-store-notice demo_store" style="display:none;">' . do_shortcode( wp_kses_post( $notice ) ) . ' <a href="#" class="woocommerce-store-notice__dismiss-link">' . esc_html__( 'Dismiss', 'woocommerce' ) . '</a></div>'; | |
return $notice_html; | |
} | |
add_filter( 'woocommerce_demo_store', 'modify_woocommerce_demo_store_notice_allow_shortcodes', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment