Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/wp-admin/css/colors/_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ span.wp-media-buttons-icon:before {
.media-modal .delete-attachment,
.media-modal .trash-attachment,
.media-modal .untrash-attachment,
.wp-core-ui .button-link-delete {
.wp-core-ui .button-link-delete,
.wp-core-ui .delete-link {
color: tokens.$alert-red;
}

Expand All @@ -76,7 +77,9 @@ span.wp-media-buttons-icon:before {
.media-modal .trash-attachment:focus,
.media-modal .untrash-attachment:focus,
.wp-core-ui .button-link-delete:hover,
.wp-core-ui .button-link-delete:focus {
.wp-core-ui .button-link-delete:focus,
.wp-core-ui .delete-link:hover,
.wp-core-ui .delete-link:focus {
color: color.adjust(tokens.$alert-red, $lightness: 10%);
}

Expand Down
11 changes: 11 additions & 0 deletions src/wp-admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,17 @@ a#remove-post-thumbnail:hover,
border: none;
}

/* Destructive action link. For use in custom plugin/theme admin pages. */
.delete-link {
color: #b32d2e;
}

.delete-link:hover,
.delete-link:focus {
color: #b32d2e;
border: none;
}

.application-password-display .success {
color: #007017;
margin-left: 0.5rem;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/edit-form-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@

<div id="major-publishing-actions">
<div id="delete-action">
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?>
<?php echo "<a class='submitdelete deletion delete-link' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?>
</div>
<div id="publishing-action">
<?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/edit-tag-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@

<?php if ( current_user_can( 'delete_term', $tag->term_id ) ) : ?>
<span id="delete-link">
<a class="delete" href="<?php echo esc_url( admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ) ); ?>"><?php _e( 'Delete' ); ?></a>
<a class="delete delete-link" href="<?php echo esc_url( admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ) ); ?>"><?php _e( 'Delete' ); ?></a>
</span>
<?php endif; ?>

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-walker-nav-menu-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur

<?php
printf(
'<a class="item-delete submitdelete deletion" id="delete-%s" href="%s">%s</a>',
'<a class="item-delete submitdelete deletion delete-link" id="delete-%s" href="%s">%s</a>',
$item_id,
wp_nonce_url(
add_query_arg(
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-comments-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,15 +832,15 @@ protected function handle_row_actions( $item, $column_name, $primary ) {

if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || ! EMPTY_TRASH_DAYS ) {
$actions['delete'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js delete-link" aria-label="%s">%s</a>',
esc_url( $delete_url ),
"delete:the-comment-list:comment-{$comment->comment_ID}::delete=1",
esc_attr__( 'Delete this comment permanently' ),
__( 'Delete Permanently' )
);
} else {
$actions['trash'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js delete-link" aria-label="%s">%s</a>',
esc_url( $trash_url ),
"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
esc_attr__( 'Move this comment to the Trash' ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-links-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
$actions['delete'] = sprintf(
'<a class="submitdelete" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
'<a class="submitdelete delete-link" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
/* translators: %s: Link name. */
esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
Expand Down
6 changes: 3 additions & 3 deletions src/wp-admin/includes/class-wp-media-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,15 @@ private function _get_row_actions( $post, $att_title ) {
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( $this->is_trash ) {
$actions['untrash'] = sprintf(
'<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
'<a href="%s" class="submitdelete aria-button-if-js delete-link" aria-label="%s">%s</a>',
esc_url( wp_nonce_url( "post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID ) ),
/* translators: %s: Attachment title. */
esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' ), $att_title ) ),
__( 'Restore' )
);
} elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
$actions['trash'] = sprintf(
'<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
'<a href="%s" class="submitdelete aria-button-if-js delete-link" aria-label="%s">%s</a>',
esc_url( wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ) ),
/* translators: %s: Attachment title. */
esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $att_title ) ),
Expand All @@ -835,7 +835,7 @@ private function _get_row_actions( $post, $att_title ) {
$show_confirmation = ( ! $this->is_trash && ! MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';

$actions['delete'] = sprintf(
'<a href="%s" class="submitdelete aria-button-if-js"%s aria-label="%s">%s</a>',
'<a href="%s" class="submitdelete aria-button-if-js delete-link"%s aria-label="%s">%s</a>',
esc_url( wp_nonce_url( "post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID ) ),
$show_confirmation,
/* translators: %s: Attachment title. */
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-posts-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
);
} elseif ( EMPTY_TRASH_DAYS ) {
$actions['trash'] = sprintf(
'<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
'<a href="%s" class="submitdelete delete-link" aria-label="%s">%s</a>',
get_delete_post_link( $post->ID ),
/* translators: %s: Post title. */
esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' ), $title ) ),
Expand All @@ -1571,7 +1571,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {

if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
$actions['delete'] = sprintf(
'<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
'<a href="%s" class="submitdelete delete-link" aria-label="%s">%s</a>',
get_delete_post_link( $post->ID, '', true ),
/* translators: %s: Post title. */
esc_attr( sprintf( __( 'Delete &#8220;%s&#8221; permanently' ), $title ) ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-terms-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ protected function handle_row_actions( $item, $column_name, $primary ) {

if ( current_user_can( 'delete_term', $tag->term_id ) ) {
$actions['delete'] = sprintf(
'<a href="%s" class="delete-tag aria-button-if-js" aria-label="%s">%s</a>',
'<a href="%s" class="delete-tag aria-button-if-js delete-link" aria-label="%s">%s</a>',
wp_nonce_url( "edit-tags.php?action=delete&amp;taxonomy=$taxonomy&amp;tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ),
/* translators: %s: Taxonomy term name. */
esc_attr( sprintf( __( 'Delete &#8220;%s&#8221;' ), $tag->name ) ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-themes-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public function display_rows() {

if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) {
$actions['delete'] = sprintf(
'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
'<a class="submitdelete deletion delete-link" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( 'themes.php?action=delete&amp;stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet ),
/* translators: %s: Theme name. */
esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) ),
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-users-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,13 @@ public function single_row( $user_object, $style = '', $role = '', $numposts = 0
&& get_current_user_id() !== $user_object->ID
&& current_user_can( 'delete_user', $user_object->ID )
) {
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . '</a>';
$actions['delete'] = "<a class='submitdelete delete-link' href='" . wp_nonce_url( "users.php?action=delete&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . '</a>';
}

if ( is_multisite()
&& current_user_can( 'remove_user', $user_object->ID )
) {
$actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . '</a>';
$actions['remove'] = "<a class='submitdelete delete-link' href='" . wp_nonce_url( $url . "action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . '</a>';
}

// Add a link to the user's author archive, if not empty.
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/includes/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function post_submit_meta_box( $post, $args = array() ) {
$delete_text = __( 'Move to Trash' );
}
?>
<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post_id ); ?>"><?php echo $delete_text; ?></a>
<a class="submitdelete deletion delete-link" href="<?php echo get_delete_post_link( $post_id ); ?>"><?php echo $delete_text; ?></a>
<?php
}
?>
Expand Down Expand Up @@ -469,15 +469,15 @@ function attachment_submit_meta_box( $post ) {
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
printf(
'<a class="submitdelete deletion" href="%1$s">%2$s</a>',
'<a class="submitdelete deletion delete-link" href="%1$s">%2$s</a>',
get_delete_post_link( $post->ID ),
__( 'Move to Trash' )
);
} else {
$show_confirmation = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';

printf(
'<a class="submitdelete deletion"%1$s href="%2$s">%3$s</a>',
'<a class="submitdelete deletion delete-link"%1$s href="%2$s">%3$s</a>',
$show_confirmation,
get_delete_post_link( $post->ID, '', true ),
__( 'Delete permanently' )
Expand Down Expand Up @@ -1134,7 +1134,7 @@ function link_submit_meta_box( $link ) {
<?php
if ( ! empty( $_GET['action'] ) && 'edit' === $_GET['action'] && current_user_can( 'manage_links' ) ) {
printf(
'<a class="submitdelete deletion" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
'<a class="submitdelete deletion delete-link" href="%s" onclick="return confirm( \'%s\' );">%s</a>',
wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ),
/* translators: %s: Link name. */
esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {
$thumbnail_html
);
$content .= '<p class="hide-if-no-js howto" id="set-post-thumbnail-desc">' . __( 'Click the image to edit or update' ) . '</p>';
$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" role="button">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';
$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" class="delete-link" role="button">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>';
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/nav-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ function wp_nav_menu_max_depth( $classes ) {
<span class="delete-action">
<?php
printf(
'<a class="submitdelete deletion menu-delete" href="%1$s">%2$s</a>',
'<a class="submitdelete deletion menu-delete delete-link" href="%1$s">%2$s</a>',
esc_url(
wp_nonce_url(
add_query_arg(
Expand Down
Loading