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!
© 2022 Advanced Custom Fields.