I struggled with this for a while. Give this a try. It’s working on my free theme
add_filter( 'woocommerce_checkout_fields' , 'your_override_checkout_fields' );
function your_override_checkout_fields( $fields ) {
$fields['order']['order_comments']['required'] = true;
return $fields;
}
Related Posts:
- add_filter the_content str_replace after shortcode
- Correct regex for wp_embed_register_handler
- WordPress Ajax always returns a 404 error
- WordPress custom taxonomy description for each post?
- Conditional statement for parent, child and grandchild pages
- How to use SRCSET with get_the_post_thumbnail()?
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- WordPress Wysiwyg Content not being displayed
- Javascript code inside “” in core WordPress files .php
- HTML table from shortcode with multiple parameters
- How do I add HTML to a PHP function [closed]
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- WordPress automatically adding html tag around PHP code
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- How to get the POST TITLE using the POST ID?
- ACF page while loop breaks footer while loop
- Load a page into a div with Ajax
- Converting HTML Template to WordPress Theme
- Multiple options not staying selected after saving
- Embed html in php code
- How to remove ?wp-mce-4103-20162941
- Customize position of social icons in upme plugin [closed]
- parts of url disappear when using # inside href=”” [closed]
- Dot is not added at the end of href
- Position banner to right of logo in header – messed up my header file
- How to separate HTML and WordPress files
- Make PHP work with HTML tags
- Syntax error when I try to insert my loop into an unordered list? [closed]
- How to make modifications only to certain elements of an HTML string on the server-side?
- Function returns text instead of html [closed]
- Printing HTML codes
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrieve the data from the sever and displaying it in a page?
- How to execute html code inside php?
- wp_insert_post() with HTML tags using PHP
- Prevent redirect to wp-login.php
- Where can I find the inline-css of my theme header?
- How to use the checked() function to check for a non-empty var
- Calling function in loop causes repeat data
- Remove   from the_excerpt
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- Link to page with posts of specific type
- Custom forms with HTML
- Wrap title and excerpt in a div (latest posts block)
- Displaying images outside the content
- how to changes mobile menu toggle breakpoint in WordPress
- PHP inside echo HTML
- html form: redirect page after form completes submit function and posts data
- WordPress User Meta value variable into Google Gauge Chart
- WordPress Post Block Element not properly parsed with the_content filter
- Add other class content with reference class value
- PHP function for horizontal Woocommerce thumbnails and badges
- What are the advantages/disadvantages of ways to use php template files?
- Configure WordPress to Use Responsive Image Rendering
- HTML comment cause issue in functions.php script root
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Slug duplicates once clicking on link
- couldnt show short code atts in category
- separate list of programs in html/javascript coming from php
- Remove span tags from WooCommerce Downloads page
- How to enable HTML tags in category description without breaking the category page
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- My single.php page skips the first div tag
- opens like sitename.com/URL
- WordPress Slider is not working
- How to display post meta bellow every posts
- Woocommerce custom attributes list help
- WooCommerce multiple custom fields code
- How to override html codes in wordpress?
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- Target a specific container to style on WordPress storefront theme
- Switch position of elements in the footer [closed]
- Create html tree sitemap
- Can’t get_users info by using json_encode
- scroll scrpit to particular button position to next id when click button
- Pass form attributes to another php template in wordpress
- Custom HTML form using PHP – help with ajax/username validation
- Code works on page-example.php by not category-example.php
- WooCommerce – Print Processing orders [closed]
- Category – “No content found”
- Add options to WordPress backend
- WordPress HTML Helper
- Automatically create a loop for post ID
- WordPress – Image href for home menu nav not working
- get_post_meta is always empty when I use wp_mail
- Save Option on Database
- Implement “No related posts for this entry” into the loop?
- ACF repeater image in video poster with jquery
- Advanced Custom Fields Show PHP in Text Areas
- Sorting Problem
- Custom HTML/CSS Theme into WordPress – SEO considerations
- How to enqueue structured data as file – jsonld file seems not to work
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- Slick slider not working on wordpress
- How to modify default tags in wp_head()
- #038 & wordpress Help
- How can I change text on my SearchWP search results page, as this is not an editable page in WordPress?