WordPress.org

Make WordPress Core

Ticket #9777: 9777.8.diff

File 9777.8.diff, 3.7 KB (added by bradt, 6 years ago)

Improved the UI.

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

    diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
    index 6a1e9d7..46d26e2 100644
    hr { 
    810810.submitbox .submitdelete,
    811811#media-items a.delete,
    812812#media-items a.delete-permanently,
    813 #nav-menu-footer .menu-delete {
     813#nav-menu-footer .menu-delete,
     814#delete-link a.delete  {
    814815        color: #a00;
    815816}
    816817
    abbr.required, 
    826827.submitbox .submitdelete:hover,
    827828#media-items a.delete:hover,
    828829#media-items a.delete-permanently:hover,
    829 #nav-menu-footer .menu-delete:hover {
     830#nav-menu-footer .menu-delete:hover,
     831#delete-link a.delete:hover {
    830832        color: #f00;
    831833        text-decoration: none;
    832834        border: none;
    abbr.required, 
    850852        float: left;
    851853}
    852854
     855#delete-link {
     856        line-height: 28px;
     857        vertical-align: middle;
     858        text-align: left;
     859        margin-left: 8px;
     860}
     861
     862#delete-link a {
     863        text-decoration: none;
     864}
     865
    853866#publishing-action {
    854867        text-align: right;
    855868        float: right;
  • src/wp-admin/css/edit.css

    diff --git src/wp-admin/css/edit.css src/wp-admin/css/edit.css
    index 7d9ef95..d2c6653 100644
    p.popular-tags a { 
    11391139        text-decoration: underline;
    11401140}
    11411141
     1142#edittag {
     1143        max-width: 800px;
     1144}
     1145
     1146.edit-tag-actions {
     1147        margin-top: 20px;
     1148        overflow: hidden;
     1149        background-color: #e5e5e5;
     1150        padding: 10px;
     1151        margin-right: 10px;
     1152}
     1153
     1154.edit-tag-actions .button-primary {
     1155        float: right;
     1156}
     1157
    11421158/* Comments */
    11431159
    11441160.comment-php .wp-editor-area {
    table.links-table { 
    13621378}
    13631379
    13641380@media screen and ( max-width: 782px ) {
     1381        .wp-core-ui .edit-tag-actions .button-primary {
     1382                margin-bottom: 0;
     1383        }
     1384
    13651385        #post-body-content {
    13661386                min-width: 0;
    13671387        }
  • src/wp-admin/edit-tag-form.php

    diff --git src/wp-admin/edit-tag-form.php src/wp-admin/edit-tag-form.php
    index 419ddf9..581a646 100644
    if ( 'category' == $taxonomy ) { 
    215215 * @param string $taxonomy Current taxonomy slug.
    216216 */
    217217do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
    218 
    219 submit_button( __('Update') );
    220218?>
     219
     220<div class="edit-tag-actions">
     221
     222        <?php submit_button( __( 'Update' ), 'primary', null, false ); ?>
     223
     224        <?php if ( $tag_ID !== (int) get_option( 'default_category' ) ) : ?>
     225                <span id="delete-link">
     226                        <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>
     227                </span>
     228        <?php endif; ?>
     229
     230</div>
     231
    221232</form>
    222233</div>
    223234
  • src/wp-admin/edit-tags.php

    diff --git src/wp-admin/edit-tags.php src/wp-admin/edit-tags.php
    index 044ae0c..ffc0a67 100644
    case 'delete': 
    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
    case 'edit': 
    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

    diff --git src/wp-admin/js/tags.js src/wp-admin/js/tags.js
    index 333a2eb..b10c0cc 100644
    jQuery(document).ready(function($) { 
    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