WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/08/2012 04:58:34 AM (9 years ago)
Author:
koopersmith
Message:

New button styles.

Using the new buttons:

  • Button classes are now stackable.
  • All buttons should use a base class of "button".
  • Buttons default to the gray style (formerly "button-secondary"). Buttons can add a style by adding additional classes. To make a primary button, add the "button-primary" class.
  • Buttons can be rendered in various sizes. In addition to the default size, you can add "button-large", "button-small", or "button-tiny".

For backwards compatibility reasons, "button-primary" and "button-secondary" both work as standalone classes.

get_submit_button() has been adjusted to handle shorthand button classes (i.e. button classes can be passed without the "button-" prefix).

props lessbloat, helenyhou, trepmal, nacin. see #21598.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r21770 r21789  
    10851085        $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
    10861086        if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
    1087             $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
     1087            $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-tiny" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
    10881088        if ( isset($view_post) )
    1089             $return .= "<span id='view-post-btn'><a href='$permalink' class='button'>$view_post</a></span>\n";
     1089            $return .= "<span id='view-post-btn'><a href='$permalink' class='button button-tiny'>$view_post</a></span>\n";
    10901090
    10911091        $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
     
    11141114    $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
    11151115    $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    1116     $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
     1116    $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-tiny hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
    11171117    $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
    11181118    if ( isset($view_post) )
    1119         $return .= "<span id='view-post-btn'><a href='$view_link' class='button'>$view_post</a></span>\n";
     1119        $return .= "<span id='view-post-btn'><a href='$view_link' class='button button-tiny'>$view_post</a></span>\n";
    11201120
    11211121    $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
Note: See TracChangeset for help on using the changeset viewer.