In the documentation of WP REST User https://wordpress.org/plugins/wp-rest-user/ you have the aswer:
To perform further actions after user is registered, write and add_action:
add_action('wp_rest_user_user_register', 'user_registered');
function user_registered($user) {
// Do Something
}
Replace “// Do Something” for the code to change the user role. Something like this (not tested):
$u = new WP_User( 3 ); //set your user ID
// Remove role
$u->remove_role( 'subscriber' );
// Add role
$u->add_role( 'customer' );
Related Posts:
- Register a new user on wooCommerce using Rest API
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Process checkout using WC REST API
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Extend Woocommerce rest api routes fails
- Username field is not shown in Woocommerce’s registration contact form
- Custom Redirect after registration in WooCommerce
- How to filter Post using Meta Data REST API
- How to stop a Gutenberg Block from firing multiple GET Requests?
- Output JSON object with woocommerce products
- Problem with cURL and rest API
- Woo API REST : product variation price is read-only?
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Category Tree In WooCommerce Product API
- Admin access for custom user capabilities
- How to upload Woocommerce product images via API? [closed]
- Force User Registration before visitng Checkout Page
- Allow WooCommerce existing customers to checkout without being logged in [closed]
- How to handle Woocommerce API credentials
- What will make Woocommerce REST API to issue 401 [closed]
- adding a script with type=”module” to woocommerce admin area
- Woocommerce custom endpoints
- Woocommerce REST API – updating an order changes custom tax calculations
- How to be able to edit custom address fields in WooCommerce admin?
- Woocommerce Rest Api Categories problem [closed]
- Auto generate user email while registration
- API returns blank response after installing & uninstalling WP-rest-api plugin
- woocommerce axios react
- Get specific values in Woocommerce Rest API
- wc_get_products() not return the images details
- Adding Product Name on Admin Panel Order list and User’s My-Account Order List
- WooCommerce – Add product with image via REST API
- Tax are not showing on order while placing order with REST API
- JWT on Woocommerce cannot work with “Customer” role user
- Woocommerce check if email already created order recently [closed]
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- WooCommerce – Create multiple product tags via rest api endpoint
- WooCommerce Registration redirect based on page ID
- Block Disposable Emails on Woocommerce Registration
- Clients with empty username are not receiving request new password email
- How disable some product features on woocomerce?
- Using the WordPress and WooCommerce REST APIs in the same Node app
- Woocommerce Register Error
- Retrieve Data from Custom Endpoint
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Add starts rating in woocommerce product comment from backend
- Prices showed without decimals separator on BACKEND. Weight/price not working on Wocommerce
- Make e-Mail optional on Woocommerce sign up
- Assign user role by text field in WordPress (Woocommerce) [closed]
- How to solve `Error getting remote image` in woocommerce rest api script?
- Getting in an exception for get product detail by id in woocommerce REST api
- Woocommerce API security concerns
- How can I send information when a order is completed to my own POS?
- Registration roles
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- How to send Woocommerce Customer Details (Name, Email and Phone Number) to Admin upon signup
- Change the customer’s name to a link on an order management page
- WC Booking query bookings with date ranges
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- Woocommerce REST API: creating variations
- Redirect After Registration on Specific Link
- Woocommerce REST API not considering discounts and coupons
- Hook woocommerce price in backend order edition
- Custom Registration Fields woocommerce
- Sort by promo code used woocommerce admin panel [closed]
- Hide/show specific products for backend users in woocommerce
- Change WooCommerce registration form/way?
- WooCommerce REST API endpoints don’t exist
- DatePicker in Woocommerce (My Account) Registration [closed]
- My custom button to add an item in the WooCommerce admin page doesn’t refresh the page
- Fetch products with filter by similar categories at same time
- Send data to external websites when there is an update or create a post
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Why is my WordPress admin not working
- Remove login fields from /customer-account page [closed]
- GET woocommerce order request is not showing meta data [closed]
- Show shipping class in admin product list
- How to add fee_lines using woocommerce rest API v3?
- My account page, don’t show the complete “Registration form”
- WooCommerce Order Sync via Custom REST API Endpoint Failing
- Update a server-side render Block when woocommerce cart block changed
- not saving the WC_Session_Handler session and removing the product from the cart session in WooCommerce’s custom rest api
- Woocommerce – Change order of products in Confirmed Order
- echo product parent category
- Woocommerce checkout page issue – Payment methods not loading – strange “Credit/Debit Card Secure Payment” form
- WooCommerce – dynamically loading checkout page using ajax not showing payment methods for guest
- SOLVED – add_action() for $product->get_date_created
- Add “new” tag for existing products
- Sort products by Sale price and stock status
- How to hide a random text with a div tag using a class on product pages with a specific tag
- Pagination in woocommerce – Limiting page-numbers
- Two Filter Issue [closed]
- How to edit wc_get_template_part for archive products
- Switch to user link shortcode
- apply_filter and add_filter conflict
- Syncing WP Database Changes Between Environments: How To Handle Merging w/o touching database
- Missing variable options on add to cart form
- Migrating WordPress + WooCommerce from server to Local
- wp-cron and woocommerce subscriptions killing performance
- Show shipping class in admin order list