| 829 | |
| 830 | /** |
| 831 | * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers, |
| 832 | * as they disregard the autocomplete setting on the editor textarea. That can break the editor |
| 833 | * when the user navigates to it with the browser's Back button. See #28037 |
| 834 | * |
| 835 | * @since 4.0 |
| 836 | */ |
| 837 | function post_form_autocomplete_off() { |
| 838 | global $is_safari, $is_chrome; |
| 839 | |
| 840 | if ( $is_safari || $is_chrome ) { |
| 841 | echo ' autocomplete="off"'; |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | add_action( 'post_edit_form_tag', 'post_form_autocomplete_off' ); |