October 22, 2020

Woocommerce: checkout form remove label and add placeholder

 

checkout form remove label and add placeholder


- Woocommerce allow you to remove any property of $field->property by using unset,

- Reference can be here: Customizing checkout fields using actions and filters,

- Here simple example of checkout form remove label and add placeholder,


e.g:

add_filter('woocommerce_checkout_fields','wc_checkout_fields_remove_callback');

function wc_checkout_fields_remove_callback($fields) {

    foreach ($fields as $cat => $value) {

        foreach ($fields[$cat] as $field => $prop) {

            unset($fields[$cat][$field]['label']);

        }

    }

   return $fields;

}


Enjoy!

10 comments:

  1. If you are searching for an Ethical Hackers Academy then you should be join Cyber Crime Awareness Society. Cyber Crime Awareness Society is one of the Best Ceh Training In Jaipur. Cyber Crime Awareness Society is IT Consulting Company managed by Ethical Hackers & IT professionals, working with Police Agencies and Cyber Crime Cell of Government in India. It is also backed by a team of Experts working with RAW, CBI, ATS, IB and Cyber Crime Cell with an aim to create India the safest place of internet in the World.

    ReplyDelete
  2. In the era of technology, from online classes to cashless transactions everything needs to be secured from various cyber-attacks, and there comes the need of cyber experts. The Cyber Crime Awareness Society (CCAS) provides Cyber Security training in Jaipur. The training sessions are offered according to the student’s convenience with flexible training hours. And in this decade of increasing cyber-attacks, there is a huge demand of cyber experts and the cyber security training by CCAS will also build your resume at professional levels. The organisation provides Training both online and offline modes.

    ReplyDelete
  3. Avenging Security PVT LTD. is the leading Seo Digital Marketing Comapny in Jaipur. which provides Keyword ranking solution by his SEO experts and professionals. If you want to increase the ranking of website in Google Search Engine Ranking Page, then contact our company.info@ccasociety.com

    Avenging Security PVT LTD. Leading Software Development, Digital Marketing, Website & Application Development, Cyber ​​Security Company Jaipur India. If you are looking for a company that provides quality work at affordable prices, then think about us!

    ReplyDelete

  4. I need to thank you for this very good read and I have bookmarked to check out new things
    from your post. Thank you very much for sharing such a useful article and Will definitely save and revisit your site
    Web Design and Development

    ReplyDelete
  5. I think this is an informative post and it is very useful and knowledgeable. A complete APP solution for dokan marketplace for your customer, vendor and Driver.

    woocommerce developer

    ReplyDelete
  6. Thanks for sharing the informative article, its a wonderfull information for me.
    we also provide these servises link text

    ReplyDelete
  7. Remove the label and adding placeholder program is hard to learn but
    I have found this blog very interesting.

    Very informative content, keep posting.

    Very interesting content, keep sharing the great work.

    If you find the best PHP Development COMPANY in Ahmedabad then Sapphire Software Solutions is the best place for you.

    ReplyDelete
  8. Amazing information you have shared with us. Everyone should read this. By WDP Technologies

    ReplyDelete
  9. This Website Development blog is fantastic. I found your post to be very useful, I really like reading your writings because I can learn so much from them. Thanks for sharing this blog!

    ReplyDelete

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...