Home › Forums › General Issues › Extract year and Month from date picker custom field › Reply To: Extract year and Month from date picker custom field
Hi @biomedikal
Perhaps you could use the update_value filter to run a custom save function.
The update_value filter is run on every value you save with ACF. It’s native functionality is to save the value to the database, however, you can hook in and do what ever you want.
Jump over to the docs and check out the filter. You will be able to look at the value saving, and extract the month / year (with an explode function) and then use the native update_postmeta function to save the value to the post!
Good luck
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.