[wp-hackers] Is there a way to get the callback function name out of a shortcode _programmatically_?

J.D. Grimes jdg at codesymphony.co
Wed Nov 13 15:36:47 UTC 2013


On Nov 13, 2013, at 10:28 AM, Nikola Nikolov <nikolov.tmw at gmail.com> wrote:

> I believe that it's worth the time to create your own solution(or borrow
> from somewhere) that would take care of everything - adding a button that
> lists all available shortcodes, displaying a generator form for each
> shortcode, inserting it in the editor, etc. - so when you add shortcode
> "xyz" you can just tell the underlying code that this shortcode has 3
> parameters(two text fields and one select field) and accepts content, it's
> called "Xyz Name" and it's description is "Lorem ipsum...".
> Based on that your code would add some UI element that would allow the user
> to select the "Xyz Name" shortcode(probably in a pop-up) and populate all
> of the fields for it(so enter something in the text fields, select
> something from the drop-down and maybe enter some content in the content
> textarea). The user then clicks "add shortcode" and the shortcode is
> magically inserted into the editor :)
> 
> Sure it would take some time to figure out a proper structure, implement it
> and make sure it works in different situations, but it would be well worth
> the time - your users will most-likely love you for it(let's face it - it's
> difficult to remember multiple shortcodes with all of their attributes and
> what they do).
> 
> Nikola

Here is something along those lines: https://github.com/scottsweb/shortcode-suggest

I’ve been meaning to try it out, but haven’t gotten around to it yet. Sounds great though.

-J.D.


More information about the wp-hackers mailing list