• Resolved johanronstrom

    (@johanronstrom)


    Hi!

    I’m having trouble with the order of execution with the Post Snippets plugin.

    This is what I’m trying to do:

    [dropdownitem type="menuitem" link="[download_url]" ]Download![/dropdownitem]

    I’m under the impression that if the Post Snippet shortcode (“[download_url]”) was replaced with it’s string, the other shortcodes (from “Easy Bootstrap Shortcode”) would resolve correctly, but now the dropdownitem just doesn’t show up…

    I realize that this is not exactly a problem in the plugin, but I was hoping someone had general tips on the order the plugins execute the shortcodes..

    Thanks!
    / johanr

    https://www.ads-software.com/plugins/post-snippets/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    You’re actually passing the string [download_url] into the dropdownitem shortcode. WordPress is aware that [download_url] is a shortcode and shall be resolved to whatever it provides when it outputs the content. Other shortcodes are per default not aware that they get a shortcode, but treats it as any other string. So in this case dropdownitem does not know that [download_url] is actually a shortcode.

    But shortcodes can be made aware of other shortcodes, but they need to add support for executing shortcodes within the shortcode.

    So in the case of Post Snippets, any shortcode you create that contains a shortcode in the snippet, will execute that nested shortcode too. But in your case, you need the shortcode [dropdownitem] to execute a shortcode on its link attribute, so for that to work, the developer of [dropdownitem] needs to add support for passing in a shortcode there.

    Hope this helps/explains.

    Cheers,
    Johan

    Thread Starter johanronstrom

    (@johanronstrom)

    Alright, I think I understand!

    I’ll have to contact the authors of Easy Bootstrap Shortcode, or consider using another bootstrap shortcode plugin.

    Thanks!
    / johanr

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order of shortcode execution’ is closed to new replies.