Skip to content

Instantly share code, notes, and snippets.

@InpsydeNiklas
Last active August 19, 2022 14:56
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 InpsydeNiklas/0e44ab66ab39f232591686d048a0e32e to your computer and use it in GitHub Desktop.
Save InpsydeNiklas/0e44ab66ab39f232591686d048a0e32e to your computer and use it in GitHub Desktop.
Exclude PayPal Payments scripts from JavaScript Minification (Frontend Optimization) in the SiteGround Optimizer plugin. Only relevant on SiteGround-hosted websites on PayPal Payments v1.9.2.
<?php
add_filter(
'sgo_js_minify_exclude',
function ( array $scripts ) {
$scripts_to_exclude = array( 'ppcp-smart-button', 'ppcp-oxxo', 'ppcp-pay-upon-invoice', 'ppcp-vaulting-myaccount-payments', 'ppcp-gateway-settings', 'ppcp-webhooks-status-page', 'ppcp-tracking' );
return array_merge( $scripts, $scripts_to_exclude );
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment