Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Last active July 7, 2016 21:20
Show Gist options
  • Save pippinsplugins/4639303 to your computer and use it in GitHub Desktop.
Save pippinsplugins/4639303 to your computer and use it in GitHub Desktop.
Remove the first and last name fields from the EDD checkout.
<?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' );
@mkraha
Copy link

mkraha commented Jun 29, 2016

How to remove or change following title:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment