I’ve been looking into something that I can make custom shortcodes with myself and I even toyed with the idea of building it with ACF. I’m pretty sure I found a shortcode builder in the WP repo tha uses ACF, but I can’t seem to find it today… I know I wasn’t dreaming. It used a CPT to with an ACF interface to create shortcodes and then there was a button added to the editor that let you add them.
Anyway, inserting them from a flex group into the WP editor is going to be the problem to overcome if you want it to happen automatically. It would be easy to trigger the click on the button to remove the layout. But I think that going this route would mean that the insertion would have to be done manually and you’d need to rely on the user to delete them. My guess is that they wouldn’t and you’d have many of the same shortcode “layouts” saved to many posts. Although you could probably use an acf/save_post filter to delete the rows of the flex field whenever the post is saved.
I love ACF too, would not build a site without it, but after thinking about it for quite some time I decided that it wasn’t really the best tool for the job and I’m going in a different direction.
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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 21, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.