You can use the woocommerce_registration_errors
hook to validate the username & set an error if your conditions aren’t met – WooCommerce will bail and pass the error back to the UI for the user:
add_filter( 'woocommerce_registration_errors', function ( WP_Error $errors, $username ) {
if ( ! preg_match( '/[a-z]/i', $username ) ) {
$errors->add( 'username', 'Username must contain alphabetic characters.' );
}
return $errors;
}, 10, 2 );
Related Posts:
- Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
- ( Woocommerce) How to get the user belonging to an order? [closed]
- WooCommerce: Webhook disabled on its own
- How to delete woo commerce order pragmatically? [closed]
- How to turn off WooCommerce user registration and manually create accounts?
- Hook and send Woocommerce data after click Place Order button
- WooCommerce Change Product Global Attribute Value via CRUD for Simple Product [closed]
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Change WooCommerce Image Size in One Product CAtegory
- Woocommerce Shop Price Position
- How to disable users from editing billing address in WooCommerce checkout?
- Move WooCommerce product tabs out of the tabs [closed]
- WooCommerce WebHook Retry
- Can I set a custom “alt” attribute with woocommerce_get_product_thumbnail()?
- Remove all Span Tags and class From Woocommerce Price [closed]
- Importing Woocommerce products with variations
- Woocommerce login not working on the first try
- Show add to cart button on shop woocommerce
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Woocommerce – Override the default templates location under the theme directory
- How to hide out of stock products in Related Products via custom query in WooCommerce
- Changing Woocommerce language without changing the language in Dashboard admin WordPress
- WOO-Commerce translation | Tried it all [closed]
- Is there a way to show Single Variation prices in the product loop when filters or attributes are active?
- Function to recalculate shipping costs on subscriptions after renewal with Automatewoo
- Creating a multisite registration form that also creates a woocommerce post
- Woocommerce: Same gross price for different tax rates [closed]
- add shoppy.gg to woocommerce instead of add to card [closed]
- List of shipping on product page [closed]
- How to show tag count for individual product post in wordpress woocommerce
- How to edit T&C checker text in Woocommerce checkout page? gettext?
- What is the reason for two classes storefront_woocommerce and storefront
- Get email type inside email template – order emails
- Caption not showing with Woo commerce thumbnails
- Change the Title Tag of Search Products Page
- API returns blank response after installing & uninstalling WP-rest-api plugin
- Confirm Password on checkout page not working in woocommerce 3.0.1
- How to check woocommerce single product tag
- In WooCommerce can you make a list of ‘steps’ for quantity increase? [closed]
- Adding author option to [products] woocommerce shortcode
- Set dynamic Options array in woocommerce_form_field
- WooCommerce product title formatting
- Redirect no product url’s to static url
- Adding a custom Shipping methods field to an order
- Undo WooCommerce CSV import
- A Woo commerce extension has deleted my old theme.How to undo? [closed]
- How can I remove a WooCommerce Product Tab’s sub section in wp-admin?
- Woocommerce Advanced Shipping (WAS) condition is not being called when selecting “Ship to different address” [closed]
- Strip string from $_product->get_title() to get a cleaner mini-cart
- WooCommerce Meta
- WooCommerce Product Table Conditional styling
- Product page attributes dropdown show price
- Smart Design for Blog + Woocommerce + LearnDash + Forum/Bodyboss
- Ajax add to cart not updating Elementor mini cart totals
- I want to store user password (during registration) in an other table in the same database in addition to the user table MD5 Hash
- How to edit the default woo-commerce Store page meta title tag “Products”
- How can I make a thumbnail slider
- WooCommerce – 500k Jump in Order Number?
- Custom Email via Hook only for completed order
- Need help with woocommerce roles
- Change WooCommerce product and variation prices programatically without affecting performance
- Help to locate a woocommerce hook method
- woocommerce_product_quick_edit_save hook not fired
- Changing Title Tag on Shop Archive Page (current solution reverting to Title of First Product in Loop)
- What is the meta_key for woocommerce discount amount?
- I can’t add pictures to the product attribute item in woocommerce
- Can I use taxonomies to make a multistore with woocommerce?
- Why does wc_get_products($arg) return no products when $arg = ‘average_rating’ => 5.0
- Query product’s image path by category WooCommerce database?
- Delete comma in front of currency woocommerce
- Not displaying Category and subcategory from woocommerce Pluign
- woocommerce_sessions – Table does not exist
- How update price for variable product
- currentURL is not defined
- Woocommerce add 15% discount to a product if quantity is greater than or equal to 6
- Related products based on keywords
- Add button linked to single product page on order detail page
- Woocommerce REST API not considering discounts and coupons
- Multiple sorting criteries (order by)
- syntax error – woocommerce
- How to on/off woocommerce filter with redux framework [closed]
- How to set up a single product shop with woocommerce? Skipping the product archive
- I’m trying to display product categories on each product in the list
- Cross-sells on WooCommerce product page
- Admin Order adding an extra product on add_line_item
- Woocommerce update cart
- Get WP All Export row ID
- Is it possible Different templates of products for specific category in WooCommerce?
- WooCommerce – missing products when viewed by tag
- Quotes not rendering properly in WooCommerce settings API [closed]
- Hiding all products except for one in wordpress admin panel
- Allow authors to use their own PayPal account and payment process automation [closed]
- Can a woocommerce hook alter the UI of a website?
- Edit woocommerce subscription email
- cannot create product attribute (taxonomy) and add terms on the same execution
- error 500 in Back Office when using a woocommerce function in functions.php
- What is the best and cheapest way to generate dashboards about conversions data and store users? [closed]
- Sort by price when price is set in multiple keys
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category