Please consider leaving a donation if you appreciate this information. Lightning network now available
WooCommerce, by default, will change the WordPress display name for any given user to their First Name Last Name when that user makes a purchase through WooCommerce. This probably makes a lot of sense in the interest of customer relationships, but there may be cases where this is undesirable, say in the case of a forum on your site that uses the display name. Perhaps users would rather maintain a bit of anonymity on your forums. Not to worry, however, WooCommerce provides a filter that can be used to prevent this behavior. The filter is named woocommerce_update_customer_args and here is a quick example of how that can be implemented to set the display name to the username:
Not sure what to do with code snippets? See What Do I Do With These Code Snippets?
Please consider leaving a donation if you appreciate this information. Lightning network now available
Leave a Reply
You must be registered and logged in to post a comment.