Support

Account

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.