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:
parent
838444446b
commit
e3e1433e9a
|
@ -580,11 +580,9 @@ body.folded .theme-overlay .theme-wrap {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.broken-themes a.delete-theme,
|
||||||
.theme-overlay .theme-actions .delete-theme {
|
.theme-overlay .theme-actions .delete-theme {
|
||||||
color: #a00;
|
color: #a00;
|
||||||
position: absolute;
|
|
||||||
left: 10px;
|
|
||||||
bottom: 5px;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
|
@ -592,6 +590,14 @@ body.folded .theme-overlay .theme-wrap {
|
||||||
background: transparent;
|
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:hover,
|
||||||
.theme-overlay .theme-actions .delete-theme:focus {
|
.theme-overlay .theme-actions .delete-theme:focus {
|
||||||
background: #d54e21;
|
background: #d54e21;
|
||||||
|
@ -1729,4 +1735,8 @@ body.full-overlay-active {
|
||||||
.available-theme .action-links .delete-theme a {
|
.available-theme .action-links .delete-theme a {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.broken-themes table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -580,11 +580,9 @@ body.folded .theme-overlay .theme-wrap {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.broken-themes a.delete-theme,
|
||||||
.theme-overlay .theme-actions .delete-theme {
|
.theme-overlay .theme-actions .delete-theme {
|
||||||
color: #a00;
|
color: #a00;
|
||||||
position: absolute;
|
|
||||||
right: 10px;
|
|
||||||
bottom: 5px;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
|
@ -592,6 +590,14 @@ body.folded .theme-overlay .theme-wrap {
|
||||||
background: transparent;
|
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:hover,
|
||||||
.theme-overlay .theme-actions .delete-theme:focus {
|
.theme-overlay .theme-actions .delete-theme:focus {
|
||||||
background: #d54e21;
|
background: #d54e21;
|
||||||
|
@ -1729,4 +1735,8 @@ body.full-overlay-active {
|
||||||
.available-theme .action-links .delete-theme a {
|
.available-theme .action-links .delete-theme a {
|
||||||
padding: 0;
|
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
|
@ -1659,6 +1659,10 @@ $( document ).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
themes.Run.init();
|
themes.Run.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$( '.broken-themes .delete-theme' ).on( 'click', function() {
|
||||||
|
return confirm( _wpThemeSettings.settings.confirmDelete );
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})( jQuery );
|
})( jQuery );
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -246,20 +246,37 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
|
||||||
<h3><?php _e('Broken Themes'); ?></h3>
|
<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>
|
<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>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php _ex('Name', 'theme name'); ?></th>
|
<th><?php _ex('Name', 'theme name'); ?></th>
|
||||||
<th><?php _e('Description'); ?></th>
|
<th><?php _e('Description'); ?></th>
|
||||||
|
<?php if ( $can_delete ) { ?>
|
||||||
|
<th></th>
|
||||||
|
<?php } ?>
|
||||||
|
</tr>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php foreach ( $broken_themes as $broken_theme ) : ?>
|
||||||
foreach ( $broken_themes as $broken_theme ) {
|
|
||||||
echo "
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>" . ( $broken_theme->get( 'Name' ) ? $broken_theme->get( 'Name' ) : $broken_theme->get_stylesheet() ) . "</td>
|
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
|
||||||
<td>" . $broken_theme->errors()->get_error_message() . "</td>
|
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
|
||||||
</tr>";
|
<?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>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue