The second part of the problem is solved by putting this code into theme’s functions.php file :
// First name as default display name
add_action( 'profile_update', 'set_display_name', 10 );
function set_display_name( $user_id ) {
$data = get_userdata( $user_id );
if($data->first_name) {
remove_action( 'profile_update', 'set_display_name', 10 ); // profile_update is called by wp_update_user, so we need to remove it before call, to avoid infinite recursion
wp_update_user(
array (
'ID' => $user_id,
'display_name' => "$data->first_name"
)
);
add_action( 'profile_update', 'set_display_name', 10 );
}
}
Only the first problem remains to be solved that is to add “Digits” phone number field to billing_phone field in woocommerce orders.
Related Posts:
- Show only geolocated user country into Woocommerce checkout country fields
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- Using a filter with multiple parameters and $this
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- Redirect no product url’s to static url
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- Display custom product option in admin order details
- How can i add product Accessories from front-end using custom php form?
- Add suffix to price html does not work
- With what hook do I remove WooCommerce existing Product Data Tab form fields?
- Add second price option based on payment method at cart item price
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Filter hook before create order WooCommerce
- How to get rid of the hover zoom in WooCommerce single products
- What’s the difference between WC() and $woocommerce
- How to change Woocommerce breadcrumbs content?
- Hook and send Woocommerce data after click Place Order button
- Reverse engineering of WooCommerce Storefront filters
- How to modify “[Product] has been added to your cart” in WooCommerce?
- WordPress codex: apply_filters – clarification on creating a new hook on the fly. How do we use it?
- The correct way to override WooCommerce product gallery from a plugin [closed]
- display available size on hover, in woocommerce shop page [closed]
- Woocommerce – Hide a Column in Cart Table
- How can I show an empty WooCommerce cart? [closed]
- Filter on a custom product attribute in WooCommerce using meta_query or tax_query [closed]
- How To Change The Html of Products filtration sidebar in Woocommerce?
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Accessing parameters when adding filter
- Remove Order List Row Link in WooCommerce Admin?
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Edit WooCommerce product content based on category
- differentiate hooks and filters on the same page [closed]
- ‘profile_update’ hook alternative for WooCommerce user meta data
- How to update custom field in WooCommerce
- Separeting product from post in search result
- Woocommerce get billing state manually
- How to subscribe free subscription on user registration in woocommerce subscription plugin?
- How to list all WC products by their attributes values?
- Showing the WordPress standard text area on a Woocommerce Single Product Page?
- WooCommerce order complete email logic
- Filtering WooCommerce Orders by Category
- Add default user field to WooCommerce checkout [closed]
- How to Update the Order-Items While Editing an Order on the WooCommerce Admin Order Screen [closed]
- Woocommerce: Complex query in pre_get_posts [closed]
- Using a filter to change a path
- Remove an action by extending class and replacing it
- How to re-arrange this hooked content?
- Pre filter woocommerce products to remove a certain category of products
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- How to add order status class to the body tag?
- password_reset doesnt work
- How to output woocommerce products to a page, style and modify the html structure
- Filter default_content only for products
- Woocommerce – Adding row to cart table
- How can I remove a WooCommerce Product Tab’s sub section in wp-admin?
- Conditional action hook
- How can I override wp_price woocommerce function in my theme
- How to access page variable inside action hook
- Conditionally run function based on custom meta value?
- How to sort WooCommerce products page by latest in-stock items first?
- How to check if woocommerce_order_item_name is use in email?
- Hooks For Design variation in woo commerce single product page
- How to create a WooCommerce Product filter based on PHP foreach
- Use ID as slug for product category by default in WooCommerce?
- What is the problem with these lines of code?
- Two Filter Issue [closed]
- Missing variable options on add to cart form
- Running JavaScript after using WooCommerce Filter Plugin
- Redirecting orders by company field
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- Help to locate a woocommerce hook method
- Combine one action and one filter
- I’m getting error Ultimate WooCommerce Filters
- How to display two different custom taxonomy terms on a WooCommerce single product page
- How to add woocommerce product price filter widget to other page
- Unable to call woocommerce hook in my custom php file
- How to change lost password email text using custom plugin wordpress?
- Overriding Plugin function in your child theme
- woocommerce_add_to_cart custom function called several times
- How to track product price changes?
- Filter orders in Admin area based on logged in user
- Remove username and account password field from checkout page
- Display product thumbnail in Woocommerce email notifications
- woocommerce price filter not working when change currency
- How to hook in to WooCommerce Related Products
- Hide add to cart when product variation has no price or is unavailable
- Hook woocommerce price in backend order edition
- WooCommerce Admin Only Email Hook
- Create woocommerce order on new user registration
- WooCommerce comments_template Filter Not Firing
- WooCommerce Hook after Billing form completed, but before payment Gateway
- Can a woocommerce hook alter the UI of a website?
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- dakon show vender address on checkout page
- AffiliateWP not calculating multiple quantities when using affwp_calc_referral_amount filter
- Hide a shipping method if cart total is higher than an amount
- Reposition variation stock message
- Add custom ID to WooCommerce product tab