diff --git a/pmpro-add-name-to-checkout.php b/pmpro-add-name-to-checkout.php index 215de28..cf071d4 100755 --- a/pmpro-add-name-to-checkout.php +++ b/pmpro-add-name-to-checkout.php @@ -14,6 +14,8 @@ * Add the fields to the form. */ function pmproan2c_pmpro_checkout_after_password() { + global $current_user; + if ( ! empty( $_REQUEST['first_name'] ) ) { $first_name = sanitize_text_field( $_REQUEST['first_name'] ); } elseif ( ! empty( $_SESSION['first_name'] ) ) { @@ -46,6 +48,29 @@ function pmproan2c_pmpro_checkout_after_password() { } add_action( 'pmpro_checkout_after_password', 'pmproan2c_pmpro_checkout_after_password' ); +/** + * If the user is logged in, we still want to show our version of the account info section. + */ +function pmproan2c_account_info_when_logged_in() { + global $current_user; + + if ( ! is_user_logged_in() ) { + return; + } + ?> +
+
+

+ +

+
+ +
+
+