-
-
Save Pebblo/7469983cd09e8f8488e956fde99a6d09 to your computer and use it in GitHub Desktop.
A snippet to disable 'PayLater' options within EE Paypal Commerce payment method.
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 //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