Themes: Make it possible to delete broken themes.

props ideag, obenland.
fixes #28165.
Built from https://develop.svn.wordpress.org/trunk@29924


git-svn-id: http://core.svn.wordpress.org/trunk@29676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-10-16 19:46:18 +00:00
parent 838444446b
commit e3e1433e9a
7 changed files with 58 additions and 17 deletions

View File

@ -580,11 +580,9 @@ body.folded .theme-overlay .theme-wrap {
margin-bottom: 5px;
}
.broken-themes a.delete-theme,
.theme-overlay .theme-actions .delete-theme {
color: #a00;
position: absolute;
left: 10px;
bottom: 5px;
text-decoration: none;
border-color: transparent;
-webkit-box-shadow: none;
@ -592,6 +590,14 @@ body.folded .theme-overlay .theme-wrap {
background: transparent;
}
.theme-overlay .theme-actions .delete-theme {
position: absolute;
left: 10px;
bottom: 5px;
}
.broken-themes a.delete-theme:hover,
.broken-themes a.delete-theme:focus,
.theme-overlay .theme-actions .delete-theme:hover,
.theme-overlay .theme-actions .delete-theme:focus {
background: #d54e21;
@ -1729,4 +1735,8 @@ body.full-overlay-active {
.available-theme .action-links .delete-theme a {
padding: 0;
}
.broken-themes table {
width: 100%;
}
}

View File

@ -580,11 +580,9 @@ body.folded .theme-overlay .theme-wrap {
margin-bottom: 5px;
}
.broken-themes a.delete-theme,
.theme-overlay .theme-actions .delete-theme {
color: #a00;
position: absolute;
right: 10px;
bottom: 5px;
text-decoration: none;
border-color: transparent;
-webkit-box-shadow: none;
@ -592,6 +590,14 @@ body.folded .theme-overlay .theme-wrap {
background: transparent;
}
.theme-overlay .theme-actions .delete-theme {
position: absolute;
right: 10px;
bottom: 5px;
}
.broken-themes a.delete-theme:hover,
.broken-themes a.delete-theme:focus,
.theme-overlay .theme-actions .delete-theme:hover,
.theme-overlay .theme-actions .delete-theme:focus {
background: #d54e21;
@ -1729,4 +1735,8 @@ body.full-overlay-active {
.available-theme .action-links .delete-theme a {
padding: 0;
}
.broken-themes table {
width: 100%;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1659,6 +1659,10 @@ $( document ).ready(function() {
} else {
themes.Run.init();
}
$( '.broken-themes .delete-theme' ).on( 'click', function() {
return confirm( _wpThemeSettings.settings.confirmDelete );
});
});
})( jQuery );

File diff suppressed because one or more lines are too long

View File

@ -246,20 +246,37 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
<h3><?php _e('Broken Themes'); ?></h3>
<p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
<?php
$can_delete = current_user_can( 'delete_themes' );
?>
<table>
<tr>
<th><?php _ex('Name', 'theme name'); ?></th>
<th><?php _e('Description'); ?></th>
<?php if ( $can_delete ) { ?>
<th></th>
<?php } ?>
</tr>
</tr>
<?php
foreach ( $broken_themes as $broken_theme ) {
echo "
<?php foreach ( $broken_themes as $broken_theme ) : ?>
<tr>
<td>" . ( $broken_theme->get( 'Name' ) ? $broken_theme->get( 'Name' ) : $broken_theme->get_stylesheet() ) . "</td>
<td>" . $broken_theme->errors()->get_error_message() . "</td>
</tr>";
}
?>
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
<?php
if ( $can_delete ) {
$stylesheet = $broken_theme->get_stylesheet();
$delete_url = add_query_arg( array(
'action' => 'delete',
'stylesheet' => urlencode( $stylesheet ),
), admin_url( 'themes.php' ) );
$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
?>
<td><a href="<?php echo esc_url( $delete_url ); ?>" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a></td>
<?php
}
?>
</tr>
<?php endforeach; ?>
</table>
</div>