Last active
July 7, 2016 21:20
-
-
Save pippinsplugins/4639303 to your computer and use it in GitHub Desktop.
Remove the first and last name fields from the EDD checkout.
This file contains hidden or 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 | |
function pw_edd_remove_names() { | |
remove_action( 'edd_purchase_form_after_user_info', 'edd_user_info_fields' ); | |
} | |
add_action( 'init', 'pw_edd_remove_names' ); | |
function pw_edd_user_info_fields() { | |
if( is_user_logged_in() ) : | |
$user_data = get_userdata( get_current_user_id() ); | |
endif; | |
?> | |
<fieldset id="edd_checkout_user_info"> | |
<legend><?php echo apply_filters( 'edd_checkout_personal_info_text', __('Personal Info', 'edd') ); ?></legend> | |
<?php do_action( 'edd_purchase_form_before_email' ); ?> | |
<p id="edd-email-wrap"> | |
<input class="edd-input required" type="email" name="edd_email" placeholder="<?php _e('Email address', 'edd'); ?>" id="edd-email" value="<?php echo is_user_logged_in() ? $user_data->user_email : ''; ?>"/> | |
<label class="edd-label" for="edd-email"><?php _e('Email Address', 'edd'); ?></label> | |
</p> | |
<?php do_action( 'edd_purchase_form_after_email' ); ?> | |
<?php do_action( 'edd_purchase_form_user_info' ); ?> | |
</fieldset> | |
<?php | |
} | |
add_action( 'edd_purchase_form_after_user_info', 'pw_edd_user_info_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to remove or change following title: