Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created May 5, 2023 13:34
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 Pebblo/7469983cd09e8f8488e956fde99a6d09 to your computer and use it in GitHub Desktop.
Save Pebblo/7469983cd09e8f8488e956fde99a6d09 to your computer and use it in GitHub Desktop.
A snippet to disable 'PayLater' options within EE Paypal Commerce payment method.
<?php //Do not include the opening PHP tag if you already have one
add_filter(
'script_loader_src',
function( $src, $handle ) {
// Only filter the specific script we want.
if ( 'eea_paypal_commerce_js_lib' === $handle ) {
// Add the argument to the exisitng URL.
$src = add_query_arg( 'disable-funding', 'paylater', $src );
}
// Return the filtered URL.
return $src;
},
10, // Default priority.
2 // IMPORTANT. Needs to match the number of accepted arguments.
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment