Prompt the user before leaving the Customizer if they have unsaved changes. props westonruter. fixes #25439.

git-svn-id: https://develop.svn.wordpress.org/trunk@29025 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2014-07-08 17:03:48 +00:00
parent 22147bfbfb
commit 0298f71032
4 changed files with 95 additions and 39 deletions

View File

@@ -1874,6 +1874,9 @@ function _wp_customize_loader_settings() {
'url' => esc_url( admin_url( 'customize.php' ) ),
'isCrossDomain' => $cross_domain,
'browser' => $browser,
'l10n' => array(
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
),
);
$script = 'var _wpCustomizeLoaderSettings = ' . json_encode( $settings ) . ';';