Skip to content

Instantly share code, notes, and snippets.

@JeroenSormani
Last active March 15, 2018 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeroenSormani/376da9338e088494cb8222c9c4f9d178 to your computer and use it in GitHub Desktop.
Save JeroenSormani/376da9338e088494cb8222c9c4f9d178 to your computer and use it in GitHub Desktop.
WooCommerce Notices Simplest Examples
<?php // For implementation instructions see: https://aceplugins.com/how-to-add-a-code-snippet/
/**
* Showing default WooCommerce styles
*/
function ace_default_woocommerce_notice_styles() {
if ( is_admin() ) return;
wc_add_notice( 'This is a Success notice', 'success' );
wc_add_notice( 'This is a Error notice', 'error' );
wc_add_notice( 'This is a \'Notice\' notice', 'notice' );
}
add_action( 'woocommerce_init', 'ace_default_woocommerce_notice_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment