Make WordPress Core

Ticket #23738: enhancement23738.patch

File enhancement23738.patch, 9.2 KB (added by Dezzy, 11 years ago)

Patch for buttons.

  • wp-admin/edit.php

    From c1ff69527826992337e56c28febedc185aad9ad7 Mon Sep 17 00:00:00 2001
    From: Jan Herzan <jan.herzan@gmail.com>
    Date: Fri, 21 Mar 2014 14:50:43 +0100
    Subject: [PATCH 1/2] Some no-PHP generated buttons edited to be "primary".
    
    ---
     wp-admin/edit.php                | 2 +-
     wp-admin/includes/media.php      | 2 +-
     wp-admin/includes/meta-boxes.php | 6 +++---
     wp-admin/includes/template.php   | 2 +-
     wp-admin/upload.php              | 2 +-
     wp-admin/user-edit.php           | 4 ++--
     wp-admin/users.php               | 2 +-
     7 files changed, 10 insertions(+), 10 deletions(-)
    
    diff --git a/wp-admin/edit.php b/wp-admin/edit.php
    index a062b09..32a9014 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    268268<h2><?php
    269269echo esc_html( $post_type_object->labels->name );
    270270if ( current_user_can( $post_type_object->cap->create_posts ) )
    271         echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
     271        echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="button-primary">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    272272if ( ! empty( $_REQUEST['s'] ) )
    273273        printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
    274274?></h2>
  • wp-admin/includes/media.php

    diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
    index 678df79..9b2db4f 100644
    a b do_action( 'pre-plupload-upload-ui' ); ?> 
    18171817        <div class="drag-drop-inside">
    18181818        <p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
    18191819        <p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
    1820         <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
     1820        <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button-primary" /></p>
    18211821        </div>
    18221822</div>
    18231823<?php
  • wp-admin/includes/meta-boxes.php

    diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
    index 68d4611..31bc63f 100644
    a b switch ( $post->post_status ) { 
    105105<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
    106106<?php endif; ?>
    107107</select>
    108  <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
     108 <a href="#post_status" class="save-post-status hide-if-no-js button-primary"><?php _e('OK'); ?></a>
    109109 <a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
    110110</div>
    111111
    echo esc_html( $visibility_trans ); ?></span> 
    149149<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
    150150
    151151<p>
    152  <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
     152 <a href="#visibility" class="save-post-visibility hide-if-no-js button-primary"><?php _e('OK'); ?></a>
    153153 <a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
    154154</p>
    155155</div>
    function post_categories_meta_box( $post, $box ) { 
    467467                                                <?php echo $tax->labels->parent_item_colon; ?>
    468468                                        </label>
    469469                                        <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
    470                                         <input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
     470                                        <input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button-primary category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
    471471                                        <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
    472472                                        <span id="<?php echo $taxonomy; ?>-ajax-response"></span>
    473473                                </p>
  • wp-admin/includes/template.php

    diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
    index 80d6c9f..8a4d282 100644
    a b function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 
    727727?>
    728728
    729729<p>
    730 <a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a>
     730<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button-primary"><?php _e('OK'); ?></a>
    731731<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
    732732</p>
    733733<?php
  • wp-admin/upload.php

    diff --git a/wp-admin/upload.php b/wp-admin/upload.php
    index c38a0b6..249acf9 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    179179<?php
    180180echo esc_html( $title );
    181181if ( current_user_can( 'upload_files' ) ) { ?>
    182         <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
     182        <a href="media-new.php" class="button-primary"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
    183183}
    184184if ( ! empty( $_REQUEST['s'] ) )
    185185        printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
  • wp-admin/user-edit.php

    diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
    index 7274f4d..e994865 100644
    a b include (ABSPATH . 'wp-admin/admin-header.php'); 
    215215echo esc_html( $title );
    216216if ( ! IS_PROFILE_PAGE ) {
    217217        if ( current_user_can( 'create_users' ) ) { ?>
    218                 <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
     218                <a href="user-new.php" class="button-primary"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
    219219        <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
    220                 <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
     220                <a href="user-new.php" class="button-primary"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
    221221        <?php }
    222222} ?>
    223223</h2>
  • wp-admin/users.php

    diff --git a/wp-admin/users.php b/wp-admin/users.php
    index 1dfd73c..92db16d 100644
    a b if ( ! empty($messages) ) { 
    427427<?php
    428428echo esc_html( $title );
    429429if ( current_user_can( 'create_users' ) ) { ?>
    430         <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
     430        <a href="user-new.php" class="button-primary"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
    431431<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
    432432        <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
    433433<?php }
  • wp-admin/includes/media.php

    -- 
    1.8.0.msysgit.0
    
    
    From c955db7040d5e0a91f55f7356e2eadcb9a0f3780 Mon Sep 17 00:00:00 2001
    From: Jan Herzan <jan.herzan@gmail.com>
    Date: Fri, 21 Mar 2014 14:51:08 +0100
    Subject: [PATCH 2/2] Some PHP generated submit buttons edited to be
     "primary".
    
    ---
     wp-admin/includes/media.php    | 2 +-
     wp-admin/includes/template.php | 2 +-
     wp-admin/users.php             | 2 +-
     3 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
    index 9b2db4f..c768e7c 100644
    a b do_action( 'post-plupload-upload-ui' ); ?> 
    18421842        <p id="async-upload-wrap">
    18431843                <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
    18441844                <input type="file" name="async-upload" id="async-upload" />
    1845                 <?php submit_button( __( 'Upload' ), 'button', 'html-upload', false ); ?>
     1845                <?php submit_button( __( 'Upload' ), 'button-primary', 'html-upload', false ); ?>
    18461846                <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
    18471847        </p>
    18481848        <div class="clear"></div>
  • wp-admin/includes/template.php

    diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
    index 8a4d282..0e2346e 100644
    a b function wp_import_upload_form( $action ) { 
    838838<input type="hidden" name="action" value="save" />
    839839<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
    840840</p>
    841 <?php submit_button( __('Upload file and import'), 'button' ); ?>
     841<?php submit_button( __('Upload file and import') ); ?>
    842842</form>
    843843<?php
    844844        endif;
  • wp-admin/users.php

    diff --git a/wp-admin/users.php b/wp-admin/users.php
    index 92db16d..b529c95 100644
    a b case 'delete': 
    249249                wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li>
    250250        </ul></fieldset>
    251251        <input type="hidden" name="action" value="dodelete" />
    252         <?php submit_button( __('Confirm Deletion'), 'secondary' ); ?>
     252        <?php submit_button( __('Confirm Deletion') ); ?>
    253253<?php else : ?>
    254254        <p><?php _e('There are no valid users selected for deletion.'); ?></p>
    255255<?php endif; ?>