Home › Forums › General Issues › Extract year and Month from date picker custom field › Reply To: Extract year and Month from date picker custom field
ACF uses a filter called acf/update_value to save the value into the database. I have set it up as a filter so you can hook in and modify the value before save, or use the value in another way.
Please read the docs about this filter to understand it with more clarity.
You would hook in using the field name or key, then use the value that was posted to do what ever you want.
in your case, you would explode the string to get the day, month and year in an array. Then save the month and array to the database using WP save functions
Is there anything in particular you don’t understand?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp
— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.