Shortcodes in Sidebar

설명

Paste a shortcode into a Custom HTML widget and WordPress prints it exactly as you typed it — [contact-form], square brackets and all — instead of running it. This plugin fixes that, and nothing else.

What changed since version 3.0

When this plugin was written in 2011, WordPress ran no shortcodes in any widget, and one line of code fixed it for every sidebar on the site. WordPress has caught up since:

  • Text widget — core has run shortcodes since WordPress 4.8.
  • Block widgets — core has run shortcodes since WordPress 5.8.
  • Custom HTML widget — core still does not, on any version, including 7.0.

So the plugin now does the one thing that is still missing. Where core already handles shortcodes, it deliberately stays out of the way — running them a second time is not a feature.

If you have been using version 3.0 on a recent WordPress, this release is also a bug fix. The old code hooked shortcodes onto the Text widget in a way that made core skip its own, correctly ordered pass, and shortcode output could come out with paragraph tags injected into the middle of it. That no longer happens.

Features

  • Shortcodes run in the Custom HTML widget, in every sidebar and widget area.
  • No settings, no setup. Activate it and it works.
  • No database tables, no options, no scripts, no styles, no tracking, no ads, no upsells.
  • Nothing to clean up when you delete it, because it stores nothing.

Privacy

The plugin collects nothing, stores nothing, and makes no external requests.

설치

From your dashboard

  1. Go to Plugins > Add New.
  2. Search for Shortcodes in Sidebar.
  3. Click Install Now, then Activate.

Manual installation

  1. Download the plugin ZIP file.
  2. Go to Plugins > Add New > Upload Plugin and choose the file, or unzip it into /wp-content/plugins/.
  3. Activate the plugin through the Plugins screen.

There is nothing to configure. Add your shortcode to a Custom HTML widget and it runs.

FAQ

Are there any settings?

No. The plugin is either active or it is not.

Do I still need this plugin?

Only if you use the Custom HTML widget. Shortcodes in the Text widget and in block widgets are handled by WordPress itself now, and this plugin does not interfere with either.

My shortcodes already work in a Text widget. Why?

Because WordPress has done that for you since version 4.8. Earlier releases of this plugin did it too, which is why you may remember needing it.

I upgraded from 3.0 and something looks different

Version 3.0 ran shortcodes in the Text widget before WordPress added its paragraph formatting, so shortcode output could end up with stray <p> tags inside it. WordPress now runs them afterwards, in the right order, so that markup is cleaner. The content itself is unchanged.

Does it work with the block widget editor?

Yes, in the sense that there is nothing to do: WordPress runs shortcodes in block widgets on 5.8 and above, and the Shortcode block exists for exactly that. A Custom HTML widget kept through the Legacy Widget block is covered by this plugin as normal.

Does it work with page builders and other widget areas?

Anywhere a Custom HTML widget is rendered by WordPress, yes. Widgets rendered by a builder’s own code, outside the core widget classes, are up to that builder.

Will it run shortcodes in widget titles?

No. Widget titles are not filtered by this plugin.

Why does the main file have a different name from the plugin?

shortcodes-in-sidebar-widgets.php is the name it has had since 2011. WordPress identifies an installed plugin by its file path, so renaming it would deactivate the plugin on every site that updates.

후기

2017년 10월 21일
Upload, Activate – refresh page and shortcode is running, it worked right away. Thanks for that.
모든 2 평가 읽기

기여자 & 개발자

“Shortcodes in Sidebar”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Shortcodes in Sidebar”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

26.0

Full rewrite for modern WordPress. The plugin now uses year-based version numbers.

  • Fixed: shortcodes now run in the Custom HTML widget, which WordPress has never covered.
  • Fixed: removed the widget_text shortcode filter, which on WordPress 4.8 and above stopped core from running its own correctly ordered shortcode pass, and could inject paragraph tags into shortcode output in the Text widget.
  • Changed: Text widget and block widget shortcodes are left to WordPress, which has handled them since 4.8 and 5.8 respectively — no more double processing.
  • Added: GPL-2.0 license file and full license headers.
  • Added: a test suite, plus continuous integration on PHP 7.4 through 8.4.
  • Changed: readme, plugin header and documentation rewritten; the header version and the stable tag now agree, which they had not since 2015.
  • Tested against WordPress 7.0.

3.0

  • Compatibility tag updated.

2.0

  • Compatibility tag updated.

1.0

  • First release, 5 December 2011.