This code should do it for you. It add an action to the updating of the WordPress profile, checks if the email has been updated, and if so, it updates the Woocommerce address as well.
add_action('profile_update', 'sync_woocommerce_email', 10, 2) ;
function sync_woocommerce_email( $user_id, $old_user_data ) {
$current_user = wp_get_current_user();
if ($current_user->user_email != $old_user_data->user_email) {
wp_update_user( array ( 'ID' => $current_user->ID, 'billing_email' => $current_user->user_email ) ) ;
}
}
Edit: I did something wrong here, I’m guessing its pretty basic I just haven’t seen it yet.
Related Posts:
- Woocommerce override mini-cart.php not working [closed]
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- WooCommerce Always Include Shipping Information in Checkout [closed]
- Add Products to user’s ID Woocommerce
- Woocommerce different URL for every table placed in the restaurant
- Disable Admin Bar Render on Plugin Page
- How to add product images using script?
- Woocommerce cart is a non-object inside `admin_post` action [closed]
- Woocommerce custom shared taxonomy
- Invalid shipping method, WooCommerce [closed]
- Sort products without thumbnail in WooCommerce shop page
- Create or Update thousands of woocommerce products via PHP
- Automatically adding category filter based on search string
- Make specific products accessible only to a user role in WooCommerce
- How to edit Image layout in single product page in woocommerce on wordpress?
- Woocommerce – Display active variation product price [closed]
- Need Old Version of plugins
- Serve different files depending on OS/Browser
- How to configure two SMTP Server for wordpress
- Woocommerce plugin for minimum order and add-to-card-step
- Change wordpress current_time function to different timezone
- Change the method of a class from child function.php
- Automatically add attributes to woocommerce product?
- Woocommerce API HTTP Response 401
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- How to send an automated email to the customers when product is added woocommerce
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- woocommerce product countdown not showing in variable product? [closed]
- Programmatically Process Order through WooCommerce/Stripe Payment Gateway [closed]
- Replacing a plugin function with a custom renamed function doesn’t work
- Multiple Billing forms in WooCommerce (one billing form per product)
- Filtering WooCommerce Orders by Category
- Product queue for my subscription box
- creating a custom shop page display on archive woocommerce
- Hide a Menu Item on Login
- WooCommerce: Force coupon for existing/registered customers [closed]
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- Show icons or badges under title on product archives/category pages
- Problem with add_action
- Add a “View all” button on WooCommerce product archives pages
- I am trying to make a field show and save from quickedit screen
- Cross Sells are not being shown in Cart Page. Please Help!
- How to display registered customer list as dropdown in WooCommerce checkout?
- how get curent URL slug from archive page [closed]
- Disable variations on woo commerce if out of stock
- How to add category and subcategory in WordPress custom code?
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- Edit all $wp_scripts at once to $in_footer = false
- How to make WooCommerce payment method field optional?
- WordPress – Ultimate Auction for WooCommerce
- Working on a product group in wordpress, where user choose how many children, wife and husband
- wp_query ‘s’ parameter does not work with WC_AJAX
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- Add Plugin broken after removing Booster for Woocommerce
- Display top level parent category as a single product body class (Woocommerce)
- Show prices with tax Inclusive in Minicart widget
- How to add a PW Gift Card to a Woocommerce Order request API?
- How can I send the mail once?
- WPForms Custom Redirect not working
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- Configure upload folder on WoComerce
- WordPress to be used more like an app?
- How can I find related learndash course id from woocommerce product object?
- Make the product page as homepage WooCommerce
- BS Authorize.net Problem (Payment in hanging if customers is not logged in)
- How to create a plugin with automatic update?
- Woocommerce product variation price: How to change price dynamically through hooks
- Getting all woocommerce products from REST API call in plugin
- Problem Advanced Custom Fields PRO
- Securing langugae folder
- my hook or my function wont run in the cronjob
- Add a WooCommerce Product Variant with attributes programmatically
- Get a list of Product Categories inside a loop
- WooCommerce or any other plugin: Deliver JS and CSS through CDN without using a Plugin
- Coupon Codes for product discount combined with conditional free shipping
- Custom product page’s style for printing
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Woocommerce list variations that are added already to cart in Single Product
- {status}_{post_type} does not run correctly?
- Woocommerce categories displayed on every category and shopping page
- 504 Timeout gateway when trying to pay for an order in Woocommerce. What else can I do?
- woocommerce product search based only title
- Need woocommerce function for getting cart list with items
- WPNeo Stripe connect does not work
- Widget logic using woocommerce product category
- WordPress Theme Conflict With Plugin
- How to Save settings of custom tab product page in admin side in a database?
- Holding 2 wp_user in the same action (to update billing_email when user_email is updated)
- Sort Reviews/Ratings by date on Woocommerce
- How to execute init or woocommerce_init only for checkout page
- How to add plus minus button on Input Quantity box Woocommerce? [closed]
- Woocommerce resize existing product images
- How to add a text in the checkout page woocomerce?
- Shortcode inside a redirect [closed]
- Create Custom Coupon Type
- Update acf field in woocommerce orders
- Add different sizes packaging boxes to orders plugin
- additional fields based on the quantity of products selected
- A multi-section WordPress store [closed]