add_shortcode support in Widgets

  1. OfficeVoodooKit

    It would be great if there was a checkbox on a widget that would enable it to recognize shortcut code from plugins.

    An example is [CSSBUTTON target="http://www.linktarget.com" color="000000" textcolor="ffffff"]Button Caption[/CSSBUTTON]

    The above code is from the WP CSS Button plugin

    Posted: 6 years ago #
  2. Justin Tadlock
    WordPress God

    Adding this to your theme's functions.php should work:

    add_filter( 'widget_text', 'do_shortcode' );

    I'm undecided on whether this should be allowed in widgets by default yet.

    Posted: 6 years ago #
  3. dejanstrbac

    Enables the SyncFu group buying widget on all pages.

    This plugin adds the SyncFu widget to your wordpress blog. It requires an active SyncFu.com account.

    For more information visit: SyncFu

    For any questions or issues, please visit: SyncFu Support

    1. Upload syncfu directory to the /wp-content/plugins/ directory
    2. Activate the plugin through the 'Plugins' menu in WordPress
    3. In the settings (Admin > Settings > SyncFu), enter the 40 character API key provided in the SetUp or Account Settings tab of SyncFu merchant interface
    4. While logged in at http://www.syncfu.com, create offers and afterwards paste the given button codes where desired in your wordpress.
    1. syncfu screenshot 1

      Settings panel with SyncFu installed.

    2. syncfu screenshot 2

      SyncFu settings page.

    Posted: 6 years ago #
  4. Jeremy Clarke


    The filter method works but is very onerous. Going forward I find myself using widgetized sidebars for everything, and having shorcodes in there just makes sense!

    Having a setting for shortcode parsing in widgets would mean that plugin devs don't have to create a widget, they can just give a shortcode that doesn't break as a shortcode in text widgets!

    I don't think making shortcodes work by default in widgets will hurt very many people due to the content already in their widgets, and for all future text widgets it will be very very useful.

    If shortcode parsing isn't the new default then there should be a setting to make them work. Logically it would belong with the checkbox for paragraph parsing on each widget. Personally I think having a setting deeper in WP would make more sense, as setting this for a whole site will almost always be a possibility.

    Posted: 6 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    6 Votes
  • Status

    This idea has been implemented