' . stripslashes( $options['header'] ) . '' ); } else { $html_header = ''; } // Display share buttons. ADDTOANY_SHARE_SAVE_KIT(); } } add_action( 'woocommerce_share', 'addtoany_woocommerce_share', 10 ); /** * Excludes AddToAny's assets domain from WP Rocket. */ function addtoany_wp_rocket_exclusion( $excluded ) { $excluded[] = 'static.addtoany.com'; return $excluded; } add_filter( 'rocket_minify_excluded_external_js', 'addtoany_wp_rocket_exclusion' ); // Support the `wp-consent-api` plugin's feature proposal for a WP Consent API. add_filter( "wp_consent_api_registered_{$plugin}", '__return_true' ); /** * Checks for 3rd party consent using the WP Consent API or Complianz plugin * and sets the $A2A_3p_consent accordingly. */ function addtoany_check_3p_consent() { global $A2A_3p_consent; if ( function_exists( 'wp_has_consent' ) ) { $A2A_3p_consent = wp_has_consent( 'marketing' ); } elseif ( function_exists( 'cmplz_has_consent' ) ) { $A2A_3p_consent = cmplz_has_consent( 'marketing' ); } } add_action( 'init', 'addtoany_check_3p_consent' ); /** * Disables AddToAny's content filter to avoid appearing within the UI of WPBakery's frontend editor. */ function addtoany_wpbakery_disable_add_to_content( $query ) { if ( function_exists( 'vc_is_page_editable' ) && vc_is_page_editable() ) { remove_filter( 'the_content', 'A2A_SHARE_SAVE_add_to_content', 98 ); } } add_action( 'wp', 'addtoany_wpbakery_disable_add_to_content' );