mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
a2c020e068c8eaaba978a2ca6de9c1881e2138d0
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. git-svn-id: https://develop.svn.wordpress.org/trunk@27966 602fd350-edb4-49c9-b593-d223f7449a82
Description
No description provided
Languages
PHP
80.5%
CSS
9.4%
JavaScript
8.5%
SCSS
0.9%
HTML
0.7%