mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Editor: ensure the page is refreshed when the users navigate to it with the Back or Forward buttons. In these cases the browsers usually load the page from (memory) cache and it contains the old editor content.
Fixes #35852. git-svn-id: https://develop.svn.wordpress.org/trunk@37619 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1373,3 +1373,26 @@ function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $f
|
||||
|
||||
return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
|
||||
* as they disregard the autocomplete setting on the editor textarea. That can break the editor
|
||||
* when the user navigates to it with the browser's Back button. See #28037
|
||||
*
|
||||
* Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* $deprecated 4.6.0
|
||||
*
|
||||
* @global bool $is_safari
|
||||
* @global bool $is_chrome
|
||||
*/
|
||||
function post_form_autocomplete_off() {
|
||||
global $is_safari, $is_chrome;
|
||||
|
||||
_deprecated_function( __FUNCTION__, '4.6' );
|
||||
|
||||
if ( $is_safari || $is_chrome ) {
|
||||
echo ' autocomplete="off"';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user