Thread Starter
shyton
(@shyton)
Is this code below accurate ?,It works but I just want to be extra sure if it’s safe to use
add_action( 'wp_footer', function () { ?>
<script>
document.getElementById("pmpro_btn-submit-paypalexpress").src = "https://coordonline.com/wp-content/uploads/2021/12/decorative-cardboard-boxes-for-gifts-on-the-table-850x565-1.jpg";
</script>
<?php } );
Hi there. That code might work, but there is a better way to do it on the PHP side using a filter we have in place.
Here is an article on that: https://www.paidmembershipspro.com/change-the-paypal-button-on-membership-checkout/
The article is not behind the paywall, so you should be able to access the code and stuff.
Let me know if this works for you.
Here is a link to the relevant code gist showing how to use the pmpro_paypal_button_image filter: https://gist.github.com/kimcoleman/438b2fca4cff932b68e22e547f2afaf2#file-my_pmpro_paypal_button_image-php
The article also has links to a few options for the buttons hosted by PayPal. You can also use your own image that you uploaded yourself. There may be TOS requirements on the PayPal side, so check out for those.