WordPress/wp-includes
Dominik Schilling 598907559c WP_Widget: Introduce is_preview() method.
With the Widget Customizer it's possible that previewed widgets can leak data outside of Customizer, when the widget uses the cache API.
The Customizer calls the regular update callback which should already refresh the cache. Since cache additions aren't blocked yet the cache can be filled with preview data.
To prevent this issue `WP_Widget::is_preview()` will return true, when `$wp_customize->is_preview()` returns true. If `is_preview()` is true, cache additions are suspended via `wp_suspend_cache_addition()`. Make sure your object cache drop-in has implemented `wp_suspend_cache_addition()`.

`is_preview()` can/should also be used inside `WP_Widget::widget()`, see WP_Widget_Recent_Posts or WP_Widget_Recent_Comments for examples.

For more info see IRC logs: http://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2014-04-02&sort=asc#m824279

props westonruter.
fixes #27538.
Built from https://develop.svn.wordpress.org/trunk@27966


git-svn-id: http://core.svn.wordpress.org/trunk@27796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-06 18:48:16 +00:00
..
certificates WP_HTTP: Update the Root Certificate bundle used for SSL communication by WP_HTTP. 2014-02-27 02:33:14 +00:00
css Header images: Handle cropping failures. 2014-04-04 15:48:16 +00:00
fonts Update Dashicons. 2014-03-25 12:05:16 +00:00
ID3
images Edit Image modal: 2014-03-27 22:41:14 +00:00
js TinyMCE: update the default style for html5-captions, props obenland fixes #26642 2014-04-04 23:12:16 +00:00
pomo Fix strict notices in Tests_POMO_PO. 2013-12-01 12:48:10 +00:00
SimplePie
Text
theme-compat Theme compat: Move <head profile> to <link>. 2014-03-25 17:22:15 +00:00
admin-bar.php Reference https://wordpress.org rather than http://wordpress.org in strings, links, comments, etc. 2014-03-03 02:34:27 +00:00
atomlib.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
author-template.php Remove a redundant title attribute. See #26559. Props joedolson. 2014-03-18 22:02:15 +00:00
bookmark-template.php Remove old links_recently_updated_* DB options that never had a UI. 2014-04-03 03:10:15 +00:00
bookmark.php Remove old links_recently_updated_* DB options that never had a UI. 2014-04-03 03:10:15 +00:00
cache.php Rather than removing the 3rd argument in WP_Object_Cache::delete(), mark it as $deprecated. 2014-02-11 16:41:12 +00:00
canonical.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
capabilities.php Don't default to current user for capability checks when dealing with a post without an author (post_author = 0). 2014-03-04 03:09:15 +00:00
category-template.php Popular tags' edit links should respect the current post type. Adds unit test. 2014-03-25 18:40:15 +00:00
category.php Avoid a notice in get_the_category_by_ID() when is_wp_error( $term ) is false but $term->name is not set. Clarify the @return value of get_category() and get_tag() which return the same possible types as get_term(), which they wrap. 2014-03-13 04:04:15 +00:00
class-feed.php
class-http.php Fix a typo in the PHPDoc description for the WP_Http_Curl->max_body_length property. 2014-04-05 05:48:18 +00:00
class-IXR.php Allow query strings for servers in IXR_Client and WP_HTTP_IXR_Client. 2014-03-15 05:01:14 +00:00
class-json.php
class-oembed.php Don't pass variables by reference. 2014-04-05 18:17:14 +00:00
class-phpass.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
class-phpmailer.php Update PHPMailer to 5.2.7 from 5.2.4. 2014-03-03 20:25:14 +00:00
class-pop3.php
class-simplepie.php
class-smtp.php Update PHPMailer to 5.2.7 from 5.2.4. 2014-03-03 20:25:14 +00:00
class-snoopy.php
class-wp-admin-bar.php Convert argument array documentation to the hash-notation style for WP_Admin_Bar::add_node() and WP_Admin_Bar::add_group(). 2014-03-03 06:11:13 +00:00
class-wp-ajax-response.php
class-wp-customize-control.php Header images: Accessibility and style improvements. Headers no longer jump around when chosen. 2014-04-04 15:49:15 +00:00
class-wp-customize-manager.php Widget Customizer: Convert static WP_Customize_Widgets class into instantiated class and merge Options_Transaction into WP_Customize_Widgets. 2014-03-28 14:07:14 +00:00
class-wp-customize-section.php Improve some inline documentation for class properties in WP_Customize_Section. 2014-04-02 03:02:16 +00:00
class-wp-customize-setting.php Inline documentation for hooks in wp-includes/class-wp-customize-setting.php. 2014-03-06 14:04:13 +00:00
class-wp-customize-widgets.php Widget Customizer: Remove leading underscores from public methods. 2014-04-02 18:31:15 +00:00
class-wp-editor.php Throw a user notice when the editor ID used for TinyMCE contains brackets, props nacin, fixes #27601 2014-04-05 01:11:16 +00:00
class-wp-embed.php Inline documentation for core shortcode attributes. 2014-01-07 16:07:12 +00:00
class-wp-error.php
class-wp-http-ixr-client.php Allow query strings for servers in IXR_Client and WP_HTTP_IXR_Client. 2014-03-15 05:01:14 +00:00
class-wp-image-editor-gd.php In multi_resize() image editor methods, assert that null can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this. 2014-03-27 20:40:17 +00:00
class-wp-image-editor-imagick.php In multi_resize() image editor methods, assert that null can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this. 2014-03-27 20:40:17 +00:00
class-wp-image-editor.php In multi_resize() image editor methods, assert that null can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this. 2014-03-27 20:40:17 +00:00
class-wp-theme.php WP_Theme: Return false from the display() method when get() fails. 2014-03-26 18:22:13 +00:00
class-wp-walker.php
class-wp-xmlrpc-server.php Don't pass variables by reference. 2014-04-05 18:17:14 +00:00
class-wp.php Add post_parent to the private query vars list. Fixes detached media queries. 2014-03-27 16:37:16 +00:00
class.wp-dependencies.php
class.wp-scripts.php Inline documentation for hooks in wp-includes/class.wp-scripts.php. 2014-03-26 05:48:14 +00:00
class.wp-styles.php Inline documentation for hooks in wp-includes/class.wp-styles.php. 2014-03-28 21:24:14 +00:00
comment-template.php Remove a blank line and @global reference in the PHPDoc for comment_author_email_link(). 2014-04-04 04:36:15 +00:00
comment.php Revert [27115] and let cache backends handle the stripping of spaces in cache keys as necessary. 2014-02-26 22:05:13 +00:00
compat.php
cron.php Cron: Fix a case where a cache inconsistency can cause wp_clear_scheduled_hook() to enter an infinite loop. This unravels the function from using other cron api functions to looping over the cron array directly. See #25773 2013-12-07 09:13:11 +00:00
date.php Fix a copy/paste error in WP_Date_Query parameter description. 2014-03-21 17:53:16 +00:00
default-constants.php First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin. 2013-12-24 18:57:12 +00:00
default-filters.php Allow for custom authentication handlers for all requests. 2014-03-09 15:23:15 +00:00
default-widgets.php WP_Widget: Introduce is_preview() method. 2014-04-06 18:48:16 +00:00
deprecated.php Revert [27203], restore JIT color scheme stylesheets. Restores [27111]. 2014-03-12 16:12:15 +00:00
feed-atom-comments.php Inline documentation for hooks in wp-includes/feed-atom-comments.php. 2013-12-21 20:22:12 +00:00
feed-atom.php
feed-rdf.php
feed-rss2-comments.php
feed-rss2.php
feed-rss.php
feed.php Remove all @package and @subpackage PHPDoc tags not at the file- or class-levels in core. 2014-02-25 17:14:14 +00:00
formatting.php Add braces to wptexturize() after [27839]. see #22692. 2014-03-29 09:00:15 +00:00
functions.php Adjust colors in wp_die() and install.css. 2014-03-29 23:06:14 +00:00
functions.wp-scripts.php
functions.wp-styles.php
general-template.php Introduce before_page_number and after_page_number arguments for paginate_links(). Fixes #24709. Props grahamarmfield. 2014-03-18 23:31:14 +00:00
http.php Avoid an undefined index notice in wp_http_validate_url(). 2014-04-05 12:45:15 +00:00
kses.php Inline documentation for hooks in wp-includes/kses.php. 2014-03-26 14:57:15 +00:00
l10n.php
link-template.php Revert the conversion of adjacent post queries to WP_Query. Explanation on the ticket. 2014-03-29 06:03:15 +00:00
load.php Revert the conversion of adjacent post queries to WP_Query. Explanation on the ticket. 2014-03-29 06:03:15 +00:00
locale.php
media-template.php Header images: Handle cropping failures. 2014-04-04 15:48:16 +00:00
media.php Revert the changes made to data.title in playlist Underscore templates in [27869]. {{ data.title }} causes the title to be double-encoded on the front end. 2014-04-05 20:06:16 +00:00
meta.php Fix a typo in the deleted_{$meta_type}_meta hook description. 2014-03-25 20:34:15 +00:00
ms-blogs.php Fix the return description for switch_to_blog() to reflect that it always returns true. 2014-03-02 04:41:15 +00:00
ms-default-constants.php
ms-default-filters.php
ms-deprecated.php Theme compat: Move <head profile> to <link>. 2014-03-25 17:22:15 +00:00
ms-files.php
ms-functions.php Use correct column name. See [27152]. 2014-03-29 03:39:14 +00:00
ms-load.php In get_site_by_path(), avoid passing $paths through prepare(). If a path contains a %, we end up with problems. see #27003. 2014-03-06 18:18:15 +00:00
ms-settings.php Multisite: Lowercase REQUEST_URI when matching paths. 2014-03-25 21:05:14 +00:00
nav-menu-template.php Add the ability to short-circuit wp_nav_menu() via the pre_wp_nav_menu hook. props kasparsd, DrewAPicture, Rarst. fixes #23627. 2014-03-03 20:43:15 +00:00
nav-menu.php Inline documentation for hooks in wp-includes/nav-menu.php. 2014-03-25 09:04:14 +00:00
option.php Introduce pre_update_option filter. 2014-03-28 13:57:14 +00:00
pluggable-deprecated.php Reference https://wordpress.org rather than http://wordpress.org in strings, links, comments, etc. 2014-03-03 02:34:27 +00:00
pluggable.php Inline documentation for hooks in wp-includes/pluggable.php. 2014-03-28 21:21:15 +00:00
plugin.php Introduce doing_filter() and doing_action() to identify hooks in progress. 2014-02-26 18:44:14 +00:00
post-formats.php Allow has_post_format() to be used to check for any format. 2013-11-24 13:45:10 +00:00
post-template.php Fix a regression caused by [27622] in prepend_attachment() by passing all attachments that are not audio or video to the else clause. 2014-04-02 17:14:15 +00:00
post-thumbnail-template.php Revert [27166]. 2014-03-26 18:43:14 +00:00
post.php Fix the wp_count_attachments() PHPDoc to reflect that it returns an object, not array. 2014-03-28 05:43:15 +00:00
query.php Revert the conversion of adjacent post queries to WP_Query. Explanation on the ticket. 2014-03-29 06:03:15 +00:00
registration-functions.php
registration.php
revision.php Inline documentation for hooks in wp-includes/revision.php. 2014-03-25 09:00:14 +00:00
rewrite.php Rewrite: Use same delimiter in url_to_postid() we use in WP::parse_request(). 2014-03-29 05:18:15 +00:00
rss-functions.php
rss.php
script-loader.php Bump the MediaElement version in script-loader.php to 2.14.1. 2014-03-30 22:20:14 +00:00
shortcodes.php Bail early from shortcode functions if no delimiter is present. 2014-03-04 07:11:13 +00:00
taxonomy.php Avoid infinite recursion in get_term_children() when a term is incorrectly a parent of itself. 2014-03-29 06:08:15 +00:00
template-loader.php
template.php Inline documentation improvements for get_*_template() functions in wp-includes/template.php. 2014-01-05 17:55:11 +00:00
theme.php Clarify inline documentation for the 'html5' case and PHPDoc return in add_theme_support(). 2014-03-31 22:20:16 +00:00
update.php Background Updates: Fix a PHP Warning caused by a Upgrader instance being passed into the Theme & Plugin $extra_stats parameter. See #27633 2014-04-03 05:33:14 +00:00
user.php Allow for custom authentication handlers for all requests. 2014-03-09 15:23:15 +00:00
vars.php Update the wp-inclues/vars.php file header to include Nginx as a recognized web server. 2014-01-10 18:15:13 +00:00
version.php Remove old links_recently_updated_* DB options that never had a UI. 2014-04-03 03:10:15 +00:00
widgets.php WP_Widget: Introduce is_preview() method. 2014-04-06 18:48:16 +00:00
wlwmanifest.xml The Pinking Shears stir from their slumber, awakened by what may seem, to those 2013-12-11 19:49:11 +00:00
wp-db.php Database: Fall back from ext/mysqli to ext/mysql if the connection fails. 2014-04-03 21:58:16 +00:00
wp-diff.php