Support » Plugin: Shortcoder — Create Shortcodes for Anything » verson 5.3: Custom params with dashes stopped working

  • Hi,

    It seems with the update to 5.3 any custom parameters with dashes no longer work. For example if it is like %%para-meter%% the shortcode when inserted into a page will show “-meter” and will not show anything else. Custom parameters with underscores and no dashes work just fine. I never really used underscores before, but did use a lot of dashes in my parameters… so I was wondering if this can be fixed or if this was intended at all?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author vaakash

    (@vaakash)

    Hi @kastali_bleikr

    Yes there was a bug and hyphen was never intended to be used.

    Would you please revert to _ if possible ?

    Thanks
    Aakash

    Thread Starter kastali_bleikr

    (@kastali_bleikr)

    I can probably do that, but I use shortcoder in a lot of ways and I tended to use the dashes in my parameters. So it’ll probably be redoing most of the shortcodes on the site. :/ So the main site will just have to wait to upgrade for awhile then.

    I’ve been hit by this too. When I created my first shortcode with a double-part parameter name, eg. %%previous-page%%, I specifically opted for a hyphen, because it’s the way WordPress separates multipart names.

    Thread Starter kastali_bleikr

    (@kastali_bleikr)

    I just had to replace the dash with either an underscore or just used camel case. I had used dashes in almost all of the shortcodes that had parameters. I copied each into Notepad ++ and used the search and replace to remove dashed parameters with camel case ones. It took a bit, but at least it’s fixed.

    Plugin Author vaakash

    (@vaakash)

    I’ll fix it in the next version. Meantime, please make below change.

    Change shortcoder.php line no 207 to below code.

    preg_match_all('/%%([a-zA-Z0-9_\-]+)\:?(.*?)%%/', $content, $matches);

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘verson 5.3: Custom params with dashes stopped working’ is closed to new replies.