Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Allow shortcodes in the WooCommerce Store Notice.
<?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