Home › Forums › ACF PRO › Can I improve this acf/pre_save function ? › Reply To: Can I improve this acf/pre_save function ?
1) If it’s working as a pre_save_post filter, then I would leave it there
2) Will you use the same code in other places if you break it up? The only purpose of creating separate functions is if you’re going to use those function from other places. Don’t prematurely optimize your code if you’re not sure you’re going to use that optimization.
3) I would handle it in whatever way worked and made sense to me at the time I was writing it. I would also give thought to if I will understand the code when I look at it again in 6 months or a year.
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.