Home Forums Feature Requests Use ACF as a custom shortcode generator Reply To: Use ACF as a custom shortcode generator

  • 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.