-
-
Save travislima/c7a3ff2bd20cff4634c938f8bd720cd6 to your computer and use it in GitHub Desktop.
Load content on confirmation or checkout page for PMPro.
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 | |
/** | |
* Load content for specific pages, checkout or confirmation page | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function load_my_script_for_pmpro() { | |
global $pmpro_pages; | |
if ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['confirmation'] ) || is_page( $pmpro_pages['account'] ) || is_page( $pmpro_pages['billing'] ) || is_page( $pmpro_pages['cancel'] ) || is_page( $pmpro_pages['invoice'] ) || is_page( $pmpro_pages['levels'] ) || is_page( $pmpro_pages['popup-cvv'] ) ) { | |
?> | |
<!-- script or styles go here --> | |
<?php | |
} | |
} | |
add_action( 'wp_head', 'load_my_script_for_pmpro' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "Learn how to load JS scripts to the Paid Memberships Pro pages of your membership site." at Paid Memberships Pro here: https://www.paidmembershipspro.com/learn-how-to-load-javascript-scripts-to-the-paid-memberships-pro-pages-of-your-membership-site/