WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Text Widget
[resolved] bug related to shortcodes with similar tags (10 posts)

  1. SiteSubscribe
    Member
    Posted 2 years ago #

    Hi. I think I found a bug related to shortcodes with similar tags/names.

    If you create shortcodes with the following names:
    [web-design]
    [web-design-services]

    And you embed just this one in your page:
    [web-design]

    The output is both of the shortcodes.

    Not the desired result.

    ~Jeff

    http://wordpress.org/extend/plugins/advanced-text-widget/

  2. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    Jeff, try the latest development version and let me know if it fixes the issue you're having. Thanks!

  3. SiteSubscribe
    Member
    Posted 2 years ago #

    Nope, 2.0.3 is doing the same thing.

  4. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    Jeff, I believe it's not the ATW's issue since the ATW doesn't process the shortcodes - it simply calls the do_shortcode function which is native API method.

    Are you creating your own shortcodes? If so, change the hyphens to underscore in your code and call them that way from the content. I think that's the actual problem. So, instead of doing this [web-design], do this [web_design] - just make sure the PHP code refers to the right handler.

  5. SiteSubscribe
    Member
    Posted 2 years ago #

    Thanks, I'll try that.

  6. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    Okay, I just found the official "word" on this in Codex - it is sort of a known bug in WP, check this out.

  7. SiteSubscribe
    Member
    Posted 2 years ago #

    Thanks, that looks like the issue so I'll rename my shortcodes.

    Many thanks.
    Jeff

  8. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    You're welcome, Jeff! Thanks for marking this issue as "resolved". Have a great one!

  9. SiteSubscribe
    Member
    Posted 2 years ago #

    I have confirmed that using naming convention my_shortcode does work with mutiple similar shortcode names as mentioned in this thread.

    Thanks for finding that WP issue.

  10. Max Chirkov
    Member
    Plugin Author

    Posted 2 years ago #

    You're welcome! Glad I was able to help :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic