Title: Add custom admin notice
Last modified: August 22, 2017

---

# Add custom admin notice

 *  [vailista](https://wordpress.org/support/users/vailista/)
 * (@vailista)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/add-custom-admin-notice/)
 * Hi,
    I need to checking some WC setting field has value,if is empty it will show
   notice in woocommerce admin setting page.
 * So, I trying to use “add_custom_notice”, but it will show an error:
 * Call to undefined function add_custom_notice()…
 *     ```
       function test_notice() {
       	add_custom_notice( _test, $notice_html );
       	$notice_html = ("<h1>123</h1>");
       }
       add_action( 'woocommerce_init', 'test_notice' );
       ```
   
 * BTW,I create the plugin for this code and I’m not sure what the hook to use.

The topic ‘Add custom admin notice’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3640790)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [vailista](https://wordpress.org/support/users/vailista/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/add-custom-admin-notice/)
 * Status: not resolved