Created
October 17, 2021 10:12
-
-
Save kwcjr/01f3ba3c187bb112cb5ef30282688613 to your computer and use it in GitHub Desktop.
Woocommerce admin notices
This file contains hidden or 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
function my_woocommerce_admin_notices() | |
{ | |
// Test to see if WooCommerce is active (including network activated). | |
$plugin_path = trailingslashit( WP_PLUGIN_DIR ) . 'woocommerce/woocommerce.php'; | |
if ( | |
in_array( $plugin_path, wp_get_active_and_valid_plugins() ) | |
|| in_array( $plugin_path, wp_get_active_network_plugins() ) | |
) { | |
do_action( 'admin_notices' ); | |
} | |
} | |
do_action( 'woocommerce_init', 'my_woocommerce_admin_notices', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment