WordPress.org

Make WordPress Core

Ticket #9777: 9777.7.diff

File 9777.7.diff, 3.0 KB (added by DrewAPicture, 6 years ago)

refresh

  • src/wp-admin/css/common.css

     
    794794.submitbox .submitdelete,
    795795#media-items a.delete,
    796796#media-items a.delete-permanently,
    797 #nav-menu-footer .menu-delete {
     797#nav-menu-footer .menu-delete,
     798#delete-link a.delete  {
    798799        color: #a00;
    799800}
    800801
     
    810811.submitbox .submitdelete:hover,
    811812#media-items a.delete:hover,
    812813#media-items a.delete-permanently:hover,
    813 #nav-menu-footer .menu-delete:hover {
     814#nav-menu-footer .menu-delete:hover,
     815#delete-link a.delete:hover {
    814816        color: #f00;
    815817        text-decoration: none;
    816818        border: none;
     
    834836        float: left;
    835837}
    836838
     839#delete-link {
     840        line-height: 28px;
     841        vertical-align: middle;
     842        text-align: left;
     843        margin-left: 15px;
     844}
     845
     846#delete-link a {
     847        text-decoration: none;
     848}
     849
    837850#publishing-action {
    838851        text-align: right;
    839852        float: right;
  • src/wp-admin/edit-tag-form.php

     
    211211 */
    212212do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
    213213
    214 submit_button( __('Update') );
     214submit_button( __( 'Update' ), 'primary', null, false );
    215215?>
     216
     217<?php if ( $tag_ID !== (int) get_option( 'default_category' ) ) : ?>
     218        <span id="delete-link">
     219                <a class="delete" href="<?php echo 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>
     220        </span>
     221<?php endif; ?>
    216222</form>
    217223</div>
    218224
  • src/wp-admin/edit-tags.php

     
    9191        wp_delete_term( $tag_ID, $taxonomy );
    9292
    9393        $location = add_query_arg( 'message', 2, $location );
     94        $location = remove_query_arg( array( 'tag_ID', 'action' ), $location );
    9495
    9596        break;
    9697
     
    123124        $tag_ID = (int) $_REQUEST['tag_ID'];
    124125
    125126        $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
    126         if ( ! $tag )
     127        if ( ! $tag ) {
    127128                wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
     129        }
     130
     131        wp_enqueue_script( 'admin-tags' );
     132
    128133        require_once( ABSPATH . 'wp-admin/admin-header.php' );
    129134        include( ABSPATH . 'wp-admin/edit-tag-form.php' );
    130135        include( ABSPATH . 'wp-admin/admin-footer.php' );
  • src/wp-admin/js/tags.js

     
    2828                return false;
    2929        });
    3030
     31        $( '#edittag' ).on( 'click', '.delete', function() {
     32                if ( 'undefined' === typeof showNotice ) {
     33                        return true;
     34                }
     35                return showNotice.warn();
     36        });
     37
    3138        $('#submit').click(function(){
    3239                var form = $(this).parents('form');
    3340