Go to file
Weston Ruter 6327832abe Widgets: Add shortcode support inside Text widgets.
* Used now in core to facilitate displaying inserted media. See #40854.
* The `[embed]` shortcode is not supported because there is no post context for caching oEmbed responses. This depends on #34115.
* Add `do_shortcode()` to the `widget_text_content` filter in the same way it is added for `the_content` at priority 11, with `shortcode_unautop()` called at priority 10 after `wpautop()`.
* For Text widget in legacy mode, manually apply `do_shortcode()` (and `shortcode_unautop()` if auto-paragraph checked) if the core-added `widget_text_content` filter remains, unless a plugin added `do_shortcode()` to `widget_text` to prevent applying shortcodes twice.
* Ensure that global `$post` is `null` while filters apply in the Text widget so shortcode handlers won't run with unexpected contexts.

Props westonruter, nacin, aaroncampbell.
See #40854, #34115.
Fixes #10457.


git-svn-id: https://develop.svn.wordpress.org/trunk@41361 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-10 06:32:34 +00:00
src Widgets: Add shortcode support inside Text widgets. 2017-09-10 06:32:34 +00:00
tests Widgets: Add shortcode support inside Text widgets. 2017-09-10 06:32:34 +00:00
tools/i18n DOCS: Replace HTTP links with HTTPS. 2016-06-10 04:49:09 +00:00
.editorconfig
.gitignore Build/Test Tools: Facilitate SVN and Git being co-located in the same directory. 2016-12-12 05:11:27 +00:00
.jshintrc Build/Test Tools: After [29858], update `.jsintrc` to use spaces, not tabs. 2017-01-13 04:44:53 +00:00
.travis.yml Build/Test tools: Use the latest in the 4.x and 6.x branches of PHPUnit when running tests on Travis. 2017-08-22 16:08:33 +00:00
Gruntfile.js Docs: JSDoc improvements for namespaces. 2017-09-08 18:41:20 +00:00
package.json Docs: JSDoc improvements for namespaces. 2017-09-08 18:41:20 +00:00
phpunit.xml.dist Tests: Rename ignored tests in `phpunit.xml.dist`. 2017-08-18 10:26:50 +00:00
wp-cli.yml Remove debug mode from WP-CLI by default, as it now outputs too much debugging information to be of use during normal development. 2015-11-28 18:36:06 +00:00
wp-config-sample.php Lightly clean up and improve inline documentation in wp-config-sample.php. 2015-05-10 00:05:30 +00:00
wp-tests-config-sample.php General: Improve terminology used when referring to installations of WordPress and its extensions. 2017-08-22 11:51:11 +00:00