I have an idea for a plugin. It seems doable, and not too difficult, but Elliot may have more insight into the possibility.
It would involve using ACF fields to create popup forms that insert shortcodes into the WP editor, and also if using TinyMCE it would create a view for them, and allow editing and deletion of the shortcode.
Shortcodes Ultimate has a pretty great interface for adding shortcodes, (you most likely will need to use a filter to remove all the default shortcodes it comes with), but it does not use TinyMCE views to allow editing of a shortcode.
And Shortcake is nice as well, but it has quite a few bugs and does not have the user interface like Shortcodes Ultimate.
The biggest shortfall of these two plugins though is their available field types (text, select, etc). ACF already has a large list of field types that look and work great. So all that would need to be done is utilize those fields in a popup, allow a developer to create forms for each shortcode (separate from existing Custom Field groups), and then build a shortcode based on the form values, and insert it into the editor (utilizing TinyMCE views when available).
From what I know, simply using
acf_form will not work as it requires already created field groups. But using
acf_render_field_wrap could be the core of all that is needed to create something like this.
Not sure if you’ve seen this: https://www.advancedcustomfields.com/resources/shortcode/
Is it anywhere near what you’re looking for or are you talking about actually adding acf input fields into the editor. I don’t see how that would work as they have to be inside a form to even work and you have to add acf_form_head where they’ll be used.
If you just want a way to add acf_form to the editor I’ve written a plugin myself that can do this: https://github.com/jonathan-dejong/acf-form-shortcode
Thanks for the response, but that’s not what I’m talking about. I’m talking about creating something like Shortcake but with ACF as the backend for the fields. Instead of saving values to a database, it would be generating a shortcode that then gets inserted into the editor (as a TinyMCE view).
But what is it you want the shortcode to generate? ACF field inputs? Or field outputs?
With inputs you have the issue I mentioned above.. I mean, ACF could render the inputs but it’d be very hard to make any sense of them in a theme frontend with <form> elements etc.
And with outputs.. well most of the fields are reduntant because they are just regular tinyMCE input (paragraphs, numbers, dates, links, images etc.). And for the more complex field types like repeater field.. I don’t know how one would assume to display that in the editor in a standardized way. They’re being used in so many different ways it’s impossible.
Sorry for beating down on your idea 🙂 I’ve been using ACF since the early days and I’ve developed quite a few add ons for it so I’m just trying to figure out wether this would be a good idea or not.
You must be logged in to reply to this topic.
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!
© 2023 Advanced Custom Fields.