Created
May 5, 2020 18:41
-
-
Save simonporter007/da4454d97e3012a03f6d64ad9ec9949b to your computer and use it in GitHub Desktop.
Facebook for WooCommerce: dismiss visibility notice to avoid JS error
This file contains 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
<?php // copy only if required! | |
/* | |
* Dismiss the catalog visibility notice that can cause some conflict with other plugins | |
*/ | |
function sv_dismiss_facebook_catalog_visibility_notice() { | |
if ( ! function_exists( 'facebook_for_woocommerce' ) ) { | |
return; | |
} | |
$notice_handler = facebook_for_woocommerce()->get_admin_notice_handler(); | |
$notice_id = 'wc-facebook-for-woocommerce-catalog-visibility-settings-removed'; | |
if ( ! $notice_handler->is_notice_dismissed( $notice_id ) ) { | |
$notice_handler->dismiss_notice( $notice_id ); | |
} | |
} | |
add_action( 'init', 'sv_dismiss_facebook_catalog_visibility_notice' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment