Skip to content

Instantly share code, notes, and snippets.

@itsjusteileen
Created September 13, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsjusteileen/4c427d2e354001f7f9588fef4a64b147 to your computer and use it in GitHub Desktop.
Save itsjusteileen/4c427d2e354001f7f9588fef4a64b147 to your computer and use it in GitHub Desktop.
Add the WordPress login box to the Paid Memberships Pro checkout page
<?php // do not add to your customizations plugin
/**
* An extension allowing existing members to login from the main checkout page to their account to renew or update their membership.
*/
add_action( ‘pmpro_checkout_after_pricing_fields’, ‘a_little_login_thing’ );
function a_little_login_thing() {
$label = ucwords( preg_replace( ‘/-+/‘, ’ ‘, substr( basename( __FILE__ ), 0, -4 ) ) );
echo ‘<h4> The filter, <span style=“color:grey;“>’ . current_filter() . ‘</span>, calls this function: <span style=“color:grey;“>’ . __FUNCTION__ . ‘</span> on Line ’ . __LINE__ . ' of the file ' . basename( __FILE__ ) . ' in the ' . $label . ' plugin</h4>‘;//a diagnostic line you can remove
echo ‘<div style=“width: 66%;margin: 0 auto; border: 1rem solid grey;padding: 1rem;“>‘;
echo ‘<h2 style=“text-align:center;color:tomato;“>Already a member? Login here.</h2>‘;
wp_login_form();
echo ‘</div>’;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment