diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js
index 1a91279..8c6bb31 100644
|
|
themes.view.Details = wp.Backbone.View.extend({ |
716 | 716 | |
717 | 717 | // Confirmation dialog for deleting a theme |
718 | 718 | deleteTheme: function() { |
719 | | return confirm( themes.data.settings.confirmDelete ); |
| 719 | event.preventDefault(); |
| 720 | |
| 721 | $( '#delete-theme-dialog' ).removeClass( 'hidden' ); |
| 722 | |
| 723 | $( '#delete-theme-dialog-cancel' ).on( 'click', function() { |
| 724 | $( '#delete-theme-dialog' ).addClass( 'hidden' ); |
| 725 | }); |
| 726 | |
| 727 | $( '#delete-theme-dialog-confirm' ).attr( 'href', $( '.delete-theme' ).attr( 'href' ) ); |
720 | 728 | }, |
721 | 729 | |
722 | 730 | nextTheme: function() { |
diff --git src/wp-admin/themes.php src/wp-admin/themes.php
index bf65884..83df26c 100644
|
|
wp_reset_vars( array( 'theme', 'search' ) ); |
129 | 129 | wp_localize_script( 'theme', '_wpThemeSettings', array( |
130 | 130 | 'themes' => $themes, |
131 | 131 | 'settings' => array( |
132 | | 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), |
133 | | 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, |
134 | | 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), |
135 | | 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), |
| 132 | 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), |
| 133 | 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, |
| 134 | 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), |
136 | 135 | ), |
137 | 136 | 'l10n' => array( |
138 | 137 | 'addNew' => __( 'Add New Theme' ), |
… |
… |
$can_install = current_user_can( 'install_themes' ); |
461 | 460 | </div> |
462 | 461 | </div> |
463 | 462 | </script> |
464 | | |
| 463 | <div id="delete-theme-dialog" class="notification-dialog-wrap hidden"> |
| 464 | <div class="notification-dialog-background"></div> |
| 465 | <div class="notification-dialog" style="padding:25px;"> |
| 466 | <div id="delete-theme-dialog-message"> |
| 467 | <p><?php _e( 'Are you sure you want to delete this theme?' ); ?></p> |
| 468 | <p><?php _e( "Click 'Cancel' to go back, 'OK' to confirm the delete." ); ?></p> |
| 469 | <p> |
| 470 | <a id="delete-theme-dialog-cancel" class="button button-secondary">Cancel</a> |
| 471 | <a id="delete-theme-dialog-confirm" class="button button-primary">Ok</a> |
| 472 | </p> |
| 473 | </div> |
| 474 | </div> |
| 475 | </div> |
465 | 476 | <?php require( ABSPATH . 'wp-admin/admin-footer.php' ); |