Use the following code snippet, hope it’ll work for you. I’ve tested it on my dev machine and it works just fine.
/**
* Change product category dropdown placeholder text.
*
* Product category dropdown uses selectWoo/select2
* that's why it's not possible to change the placeholder text using
* woocommerce_product_categories_widget_dropdown_args filter hook.
*
* data-placeholder="" is select2 standard data api.
*
* @param string $html Dropdown html
* @param array $args Dropdown setup arguments
*
* @return string Updated $html
*/
add_filter( 'wp_dropdown_cats', function( $html, $args ) {
if ( $args['taxonomy'] === 'product_cat' ) {
$html = str_replace( '<select', '<select data-placeholder="Custom placeholder"', $html );
}
return $html;
}, 10, 2);
Related Posts:
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Woocommerce 3.1 Add product image to order confirmation email not working
- Woocommerce: show default variation price is products list?
- WooCommerce add_to_cart url not working [closed]
- WooCommerce: display text instead of raw checkbox value email
- How to Add Product Variation with Multiple Images via WooCommerce REST API
- How to build wordpress site which will have location based services & products?
- How we can edit variations on cart page? [closed]
- new WC_Order(); Coming Back Empty
- Is there any way to find which action/hook is fired?
- Redirect user after login through woocommerce login page to page with his/her username?
- WooCommerce restore stock on order cancel
- Woocoomerce product category count including subcategories
- show shop instead of 404 page for missing products
- if statement for search results
- Woocommerce exclude specific categories products from related products
- Woocommerce: Prevent sending of email when order is “Completed”
- Apply a discount percentage to regular price WooCommerce by function
- Add sub subpage endpoint in woocommerce
- Edit WooCommerce product content based on category
- Place Order button in Checkout
- woocommerce – How Can I add author metadata for a product? [closed]
- Woocommerce: Can’t put items in cart in iframe and on iphone
- Display products by category in Woocommerce cart page?
- shortcode to display woocommerce cart total
- Woocommerce – Want to move the product tabs below short description
- Where is the CSS class ui-sortable-handle for WC_Admin_Taxonomies added?
- WooCommerce: “account is already registered with your email address”
- Enter name and email on the Product page and keep the input data on the Checkout page
- Separeting product from post in search result
- How to upload multiple image using wp_insert_post
- How can i manage total price in checkout page? [closed]
- In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?
- WooCommerce product category permalinks
- How to do string attachment with wp_mail
- Can’t show most recent comment on top with wp_list_comments() for WooCommerce reviews
- WooCommerce order complete email logic
- WooCommerce Displaying Price With & Without TAX [closed]
- Woo commerce using add_fee to add discount to cart not saving discount amount the admin backend when guest user is shopping
- How to change Attribute Type
- WooCommerce plugin won’t let me access settings
- What’s the fastest way to import products with variations in WooCommerce (CSV, XML, …) [closed]
- WOOCOOMERCE: Run function before payment gateway (paying)
- Can’t filter out variable products in sale from wp_get_products loop (or shortcode) [closed]
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- main menu hide woo commerce single products tittle
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- Benefits over using object method over property from $product?
- Order by date on category dynamically – Woocommerce
- Woocomnerce Limit Purchase value before proceed checkout
- Add to cart – button should be disabled
- WooCommerce – change child category URL structure
- How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]
- Hide Add to Cart button on woocommerce Product description page of a particular product
- How to change status of woocommerce orders when post status is changed
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to send woocommerce emails in multiple languages
- Custom WooCommerce rewrite rules with comma delimiter
- Set city as required if country is Singapore
- Woocommerce custom taxonomy filtering
- WooCommerce Simple Auctions add username to auction finished email
- Enable Gutenberg for Woocommerce
- How to change product category permalinks programmatically?
- Make e-Mail optional on Woocommerce sign up
- Missing variable options on add to cart form
- Create order actions from custom fields woocommerce
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- when product out of stock single page show button notify woo-commerce
- WooCommerce , Auto cancel orders status from processing after X days
- Change WooCommerce Word “Product” to Another Word
- How does a WooCommerce site integrate with the existing real world customer members?
- How can I send information when a order is completed to my own POS?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- How to filter result set in custom metaboxes?
- How to change lost password email text using custom plugin wordpress?
- wc_mail in foreach loop is sending only the first email
- How to fix: “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.” after malware cleaning
- How to hide / remove duplicated Woocommerce products from Shop page
- How to add product variations for large number of products in WooCommerce?
- Disable Woocommerce main shop page, but not the product category archive pages
- Woocommerce Languages Files
- How to adjust Related Page Thumb Sizes on single page?
- How to store ACF from product in user_meta?
- Changing second user role while updating/downgrading membership level – s2member [closed]
- How to edit the header banner in the search page in woocommerce?
- How can I display one product using WooCommerce
- How do I change the woocommerce product gallery to show all thumbnails instead of three at a time in a carousel?
- How to edit schema.org markup of WooCommerce?
- Turkish Character Problem on mailing
- WooCommerce: Order Details Table > Add Product Meta
- How to change redirect code? [duplicate]
- How to disable schema from Wocommerce? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- How do I remove the recurring total from thank you for your order email?
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page
- I want to Display custom woocomerce meta box in orders list