How to Add Custom Code to WP Simple Pay
Do you need to add specific functionality to your WP Simple Pay payment forms that are unavailable in the plugin settings?
If you’re not an experienced WordPress developer but somewhat comfortable with PHP or JavaScript, copying and pasting code snippets is pretty straightforward.
Just make sure to back up your site first and test on a staging or local site before changing your live site.
From there, follow the Beginner’s Guide to Pasting Snippets from the Web into WordPress from WPBeginner.
Using Our Code Snippet Library
We also have a code snippet library for WP Simple Pay. This library holds example code using various filter and action hooks available in the plugin.
We recommend using the free plugin WP Code when adding code from our snippet library.
To use one of our code snippets with WP Code, go to Code Snippets → +Add Snippet and select the Add Your Custom Code snippet.
Be sure to select the PHP Snippet Code Type and toggle your snippet to Active after you have made any necessary changes and are ready to make the code live. All other settings can remain at their defaults.
Here are just a few of the code snippets available:
- Conditionally dequeue plugin scripts and styles.
- Create a new WordPress user using the email address of one-time or subscription charges.
- Change the custom amount field to “number” type to show the decimal key on iOS & mobile browsers.
Still have questions? We’re here to help!
Last Modified: