Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created September 23, 2015 03:44
Show Gist options
  • Save SeanChDavis/7f4ae0ee60fe83ae1274 to your computer and use it in GitHub Desktop.
Save SeanChDavis/7f4ae0ee60fe83ae1274 to your computer and use it in GitHub Desktop.
EDD FES Use Vendor Display Name As Store Name
<?php // DO NOT COPY THIS LINE
/**
* User vendor's display name for store name if unedited
*/
function sd_fes_store_name_username() {
if ( class_exists( 'EDD_Front_End_Submissions' ) ) {
$the_vendor = wp_get_current_user();
$vendor_name = get_user_meta( $the_vendor->ID, 'display_name', true );
$vendor_store_name = get_user_meta( $the_vendor->ID, 'name_of_store', true );
if ( ! $vendor_store_name ) {
update_user_meta( $the_vendor->ID, 'name_of_store', $vendor_name );
}
}
}
add_action( 'init', 'sd_fes_store_name_username' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment