Skip to content

Instantly share code, notes, and snippets.

@BurlesonBrad
Last active March 23, 2016 14:21
Show Gist options
  • Save BurlesonBrad/524459b656c219000df9 to your computer and use it in GitHub Desktop.
Save BurlesonBrad/524459b656c219000df9 to your computer and use it in GitHub Desktop.
Add field for image, display name, and welcome message
<?php
$affiliate_id = affwp_get_affiliate_id();
$user_email = affwp_get_affiliate_email( $affiliate_id );
$payment_email = affwp_get_affiliate_payment_email( $affiliate_id, $user_email ); // Fallback to user_email
?>
<div id="affwp-affiliate-dashboard-profile" class="affwp-tab-content">
<h4><?php _e( 'Profile Settings', 'affiliate-wp' ); ?></h4>
<form id="affwp-affiliate-dashboard-profile-form" class="affwp-form" method="post">
<div class="affwp-wrap affwp-payment-email-wrap">
<label for="affwp-payment-email"><?php _e( 'Your payment email', 'affiliate-wp' ); ?></label>
<input id="affwp-payment-email" type="email" name="payment_email" value="<?php echo esc_attr( $payment_email ); ?>" />
</div>
<div class="affwp-wrap something_similar">
<label for="affiliate-image"><?php _e( 'Upload Your Image', 'aff_image' ); ?></label>
<input id="affiliate-image" type="upload" name="affiliate-image" value="???????????????????????" >
</div>
<div class="affwp-wrap something_similar">
<label for="affiliate-welcome"><?php _e( 'Your welcome message', 'aff_welcome' ); ?></label>
<input id="affiliate-welcom" type="text" name="affiliate-welcome" value="???????????????????????" >
</div>
<div class="affwp-wrap something_similar">
<label for="affiliate-welcome_name"><?php _e( 'Name', 'aff_welcome' ); ?></label>
<input id="affiliate-welcom" type="text" name="affiliate-welcome" value="???????????????????????" >
</div>
<div class="affwp-wrap affwp-send-notifications-wrap">
<input id="affwp-referral-notifications" type="checkbox" name="referral_notifications" value="1" <?php checked( true, get_user_meta( affwp_get_affiliate_user_id( $affiliate_id ), 'affwp_referral_notifications', true ) ); ?>/>
<label for="affwp-referral-notifications"><?php _e( 'Enable New Referral Notifications', 'affiliate-wp' ); ?></label>
</div>
<?php do_action( 'affwp_affiliate_dashboard_before_submit', $affiliate_id, affwp_get_affiliate_user_id( $affiliate_id ) ); ?>
<div class="affwp-save-profile-wrap">
<input type="hidden" name="affwp_action" value="update_profile_settings" />
<input type="hidden" name="affiliate_id" value="<?php echo absint( $affiliate_id ); ?>" />
<input type="submit" class="button" value="<?php esc_attr_e( 'Save Profile Settings', 'affiliate-wp' ); ?>" />
</div>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment