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”
- Update a server-side render Block when woocommerce cart block changed
- how to use wc_create_order with subscription product
- Disabling the free shipping method when the cart has product/s which assigned a certain shipping class [closed]
- woocommerce_email_subject_customer_completed_order
- How do I add an extra field to comment form above the submit button?
- How to put Stripe first, PayPal second on the checkout page?
- How to change product thumbnail size in storefront theme
- Whitespace between product image and gallery on initial load of lightbox product page
- Why is my WordPress login credentials missing, but work with WooCommerce?
- Update Customer JWT Woocommerce
- Woocommerce Canceled Order Notification email to admin
- Hide sidebar and change layout Blog Page using is_page() function
- How can I show “sold out” instead of “out of stock” for some products with particular tags and categories [closed]
- add_post_meta add latest data from meta_value array
- Some html elements displaing in a strange order in WordPress
- Woocommerce: sorting variable product
- How to create woocommerce products list
- add_action don’t updates theme layout when using values from the WordPress customizer
- Woocommerce: Unique price for individual basket items
- Assigning an orders Custom Field to User Data
- Custom Captcha validation on the registration form issue