Skip to content

Instantly share code, notes, and snippets.

@itsjusteileen
Forked from pbrocks/move-something.js
Last active October 11, 2018 15:03
Show Gist options
  • Save itsjusteileen/5898e0fb462bc1128ac9e9d585eaee28 to your computer and use it in GitHub Desktop.
Save itsjusteileen/5898e0fb462bc1128ac9e9d585eaee28 to your computer and use it in GitHub Desktop.
Use jQuery to move a Sponsored Seats field on the Checkout page
jQuery(document).ready(function($){
$('#pmpro_extra_seats').appendTo($('#other_discount_code_p').parent());
});
<?php
/**
* Plugin Name: PMPro Customizations
* Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
* Description: Customizations for positioning Sponsored Seats field on the checkout page. Add this php file and .js file to Customizations plugin's folder.
* Version: .1
* Author: Paid Memberships Pro
* Author URI: https://www.paidmembershipspro.com
*/
add_action( 'wp_enqueue_scripts', 'enqueueing_just_on_checkout_page' );
function enqueueing_just_on_checkout_page() {
global $pmpro_pages;
wp_register_script( 'move-something', plugins_url( 'move-something.js', __FILE__ ), array( 'jquery' ), '1.2' );
if ( is_page( $pmpro_pages['checkout'] || $pmpro_pages['confirmation'] ) ) {
wp_enqueue_script( 'move-something' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment