Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimcoleman/c92205ef6597e8532ae1588b11f660a1 to your computer and use it in GitHub Desktop.
Save kimcoleman/c92205ef6597e8532ae1588b11f660a1 to your computer and use it in GitHub Desktop.
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