Skip to content

Instantly share code, notes, and snippets.

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 simonporter007/da4454d97e3012a03f6d64ad9ec9949b to your computer and use it in GitHub Desktop.
Save simonporter007/da4454d97e3012a03f6d64ad9ec9949b to your computer and use it in GitHub Desktop.
Facebook for WooCommerce: dismiss visibility notice to avoid JS error
<?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