Make WordPress Core

Changeset 22018


Ignore:
Timestamp:
09/26/2012 07:44:43 PM (12 years ago)
Author:
nacin
Message:

New design and content for the welcome panel. First pass.

props lessbloat, helenyhou, georgestephanis, sabreuse, ryelle.
see #21368.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-classic.css

    r22016 r22018  
    855855
    856856.welcome-panel {
     857    background: #f7fcfe;
    857858    border-color: #d1e5ee;
    858859}
     
    864865}
    865866.welcome-panel h3 {
    866     text-shadow: 1px 1px 1px white;
     867    text-shadow: 1px 1px 1px #fff;
    867868}
    868869
  • trunk/wp-admin/css/colors-fresh.css

    r21944 r22018  
    846846
    847847.welcome-panel {
     848    background: #f5f5f5;
     849    background-image: -webkit-gradient(linear, left bottom, left top, from(#f5f5f5), to(#fafafa));
     850    background-image: -webkit-linear-gradient(bottom, #f5f5f5, #fafafa);
     851    background-image:    -moz-linear-gradient(bottom, #f5f5f5, #fafafa);
     852    background-image:      -o-linear-gradient(bottom, #f5f5f5, #fafafa);
     853    background-image: linear-gradient(to top, #f5f5f5, #fafafa);
    848854    border-color: #dfdfdf;
    849855}
     
    855861}
    856862.welcome-panel h3 {
    857     text-shadow: 1px 1px 1px white;
     863    text-shadow: 1px 1px 1px #fff;
    858864}
    859865
  • trunk/wp-admin/css/wp-admin-rtl.css

    r21955 r22018  
    589589.welcome-panel .wp-badge {
    590590    float: right;
    591 }
    592 
    593 .welcome-panel-content .about-description, .welcome-panel h3 {
    594     margin-left: 0;
    595     margin-right: 190px;
    596591}
    597592
  • trunk/wp-admin/css/wp-admin.css

    r22007 r22018  
    13711371    top: -1000em;
    13721372    left: 146px;
    1373     z-index: 999;
     1373    z-index: 10000;
    13741374    overflow: visible;
    13751375    border-width: 1px;
     
    21772177/* Welcome Panel */
    21782178.welcome-panel {
    2179     margin: 20px 8px;
    2180     padding: 30px 10px 20px;
    2181     border-width: 1px 0;
     2179    position: relative;
     2180    overflow: auto;
     2181    margin: 20px 0;
     2182    padding: 23px 10px 12px;
     2183    border-width: 1px;
    21822184    border-style: solid;
    2183     position: relative;
     2185    border-radius: 3px;
     2186    font-size: 13px;
    21842187    line-height: 1.6em;
    2185     overflow: auto;
    21862188}
    21872189
    21882190.welcome-panel h3 {
     2191    margin: 0;
    21892192    font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
    21902193    font-size: 32px;
    21912194    font-weight: normal;
    21922195    line-height: 1.2;
    2193     margin: 0.1em 0 0.8em;
    21942196}
    21952197.welcome-panel h4 {
    2196     font-size: 14px;
     2198    margin: 1.33em 0 0;
     2199    font-size: 13px;
     2200}
     2201
     2202.welcome-panel .about-description {
     2203    font-size: 18px;
     2204    margin: 0;
    21972205}
    21982206
     
    22072215
    22082216.welcome-panel .welcome-panel-close:before {
     2217    content: ' ';
     2218    position: absolute;
     2219    left: -12px;
     2220    width: 10px;
     2221    height: 100%;
    22092222    background: url('../images/xit.gif') 0 17% no-repeat;
    2210     content: ' ';
    2211     height: 100%;
    2212     width: 10px;
    2213     left: -12px;
    2214     position: absolute;
    22152223}
    22162224
     
    22192227}
    22202228
    2221 .welcome-panel .wp-badge {
    2222     float: left;
    2223     margin-bottom: 20px;
     2229.welcome-button {
     2230    margin: -9px 0 3px;
     2231    padding: 1em 3em;
     2232    font: normal 15px/1 sans-serif;
    22242233}
    22252234
    22262235.welcome-panel-content {
     2236    margin-left: 13px;
    22272237    max-width: 1500px;
    2228 }
    2229 
    2230 .welcome-panel-content .about-description,
    2231 .welcome-panel h3 {
    2232     margin-left: 190px;
    2233 }
    2234 
    2235 .welcome-panel p.welcome-panel-dismiss {
    2236     clear: both;
    2237     padding: 1em 0 0 0;
    22382238}
    22392239
     
    22422242    overflow: hidden;
    22432243    position: relative;
    2244     padding-left: 26px;
    22452244}
    22462245
    22472246.welcome-panel .welcome-panel-column {
    2248     margin: 0 5% 0 -25px;
    2249     padding-left: 25px;
    2250     width: 30%;
     2247    width: 32%;
    22512248    min-width: 200px;
    22522249    float: left;
    22532250}
    22542251
     2252.welcome-panel .welcome-panel-column:first-child {
     2253    width: 36%;
     2254}
     2255
    22552256.welcome-panel .welcome-panel-column.welcome-panel-last {
    22562257    margin-right: 0;
     
    22612262}
    22622263
     2264.welcome-panel-column p {
     2265    margin-top: 5px;
     2266}
     2267
    22632268.welcome-panel .welcome-panel-column ul {
    2264     margin: 1.6em 1em 1em 1.3em;
     2269    margin: 0.4em 1em 1em 1.3em;
    22652270}
    22662271
     
    22702275}
    22712276
     2277@media screen and (max-width: 870px) {
     2278    .welcome-button {
     2279        font-size: 14px;
     2280        padding: 1em 2.3em;
     2281    }
     2282
     2283    .welcome-panel .welcome-panel-column, .welcome-panel .welcome-panel-column:first-child {
     2284        display: block;
     2285        float: none;
     2286        width: 100%;
     2287    }
     2288    .welcome-panel .welcome-panel-column li {
     2289        display: inline-block;
     2290        margin-right: 13px;
     2291    }
     2292    .welcome-panel .welcome-panel-column ul {
     2293        margin: 0.4em 0 0;
     2294    }
     2295}
    22722296
    22732297/*------------------------------------------------------------------------------
  • trunk/wp-admin/includes/dashboard.php

    r21996 r22018  
    12331233 */
    12341234function wp_welcome_panel() {
    1235     global $wp_version;
    1236 
    1237     if ( ! current_user_can( 'edit_theme_options' ) )
    1238         return;
    1239 
    1240     $classes = 'welcome-panel';
    1241 
    1242     $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    1243     // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
    1244     $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
    1245     if ( $hide )
    1246         $classes .= ' hidden';
    1247 
    1248     list( $display_version ) = explode( '-', $wp_version );
    12491235    ?>
    1250     <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
    1251     <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
    1252     <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a>
    1253     <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    1254 
    12551236    <div class="welcome-panel-content">
    1256     <h3><?php _e( 'Welcome to your new WordPress site!' ); ?></h3>
    1257     <p class="about-description"><?php _e( 'If you need help getting started, check out our documentation on <a href="http://codex.wordpress.org/First_Steps_With_WordPress">First Steps with WordPress</a>. If you&#8217;d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?></p>
     1237    <h3><?php _e( 'Welcome to WordPress!' ); ?></h3>
     1238    <p class="about-description"><?php _e( 'We&#8217;ve assembled some links to get you started:' ); ?></p>
    12581239    <div class="welcome-panel-column-container">
    12591240    <div class="welcome-panel-column">
    1260         <h4><span class="icon16 icon-settings"></span> <?php _e( 'Basic Settings' ); ?></h4>
    1261         <p><?php _e( 'Here are a few easy things you can do to get your feet wet. Make sure to click Save on each Settings screen.' ); ?></p>
    1262         <ul>
    1263         <li><?php echo sprintf( __( '<a href="%s">Select your tagline and time zone</a>' ), esc_url( admin_url('options-general.php') ) ); ?></li>
    1264         <li><?php echo sprintf( __( '<a href="%s">Turn comments on or off</a>' ), esc_url( admin_url('options-discussion.php') ) ); ?></li>
    1265         <li><?php echo sprintf( __( '<a href="%s">Fill in your profile</a>' ), esc_url( get_edit_profile_url( get_current_user_id() ) ) ); ?></li>
    1266         </ul>
     1241        <h4><?php _e( 'Get Started' ); ?></h4>
     1242        <p><?php _e( 'First, tweak the look of your site:' ); ?></p>
     1243        <a class="button-primary welcome-button" href="<?php echo add_query_arg( 'url', urlencode( admin_url( '/' ) ), wp_customize_url() ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
     1244        <?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
     1245            <p><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), admin_url( 'themes.php' ) ); ?></p>
     1246        <?php endif; ?>
    12671247    </div>
    12681248    <div class="welcome-panel-column">
    1269         <h4><span class="icon16 icon-page"></span> <?php _e( 'Add Real Content' ); ?></h4>
    1270         <p><?php _e( 'Check out the sample page & post editors to see how it all works, then delete the default content and write your own!' ); ?></p>
     1249        <h4><?php _e( 'Next Steps' ); ?></h4>
    12711250        <ul>
    1272         <li><?php echo sprintf( __( 'View the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( get_permalink( 2 ) ), esc_url( get_permalink( 1 ) ) ); ?></li>
    1273         <li><?php echo sprintf( __( 'Delete the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( admin_url('edit.php?post_type=page') ), esc_url( admin_url('edit.php') ) ); ?></li>
    1274         <li><?php echo sprintf( __( '<a href="%s">Create an About Me page</a>' ), esc_url( admin_url('edit.php?post_type=page') ) ); ?></li>
    1275         <li><?php echo sprintf( __( '<a href="%s">Write your first post</a>' ), esc_url( admin_url('post-new.php') ) ); ?></li>
     1251        <?php if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_for_posts' ) ) : ?>
     1252            <li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
     1253            <li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1254        <?php elseif ( 'page' == get_option( 'show_on_front' ) ) : ?>
     1255            <li><?php printf( '<a href="%s">' . __( 'Edit your front page' ) . '</a>', get_edit_post_link( get_option( 'page_on_front' ) ) ); ?></li>
     1256            <li><?php printf( '<a href="%s">' . __( 'Add additional pages' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1257            <li><?php printf( '<a href="%s">' . __( 'Add a blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
     1258        <?php else : ?>
     1259            <li><?php printf( '<a href="%s">' . __( 'Write your first blog post' ) . '</a>', admin_url( 'post-new.php' ) ); ?></li>
     1260            <li><?php printf( '<a href="%s">' . __( 'Add an About page' ) . '</a>', admin_url( 'post-new.php?post_type=page' ) ); ?></li>
     1261        <?php endif; ?>
     1262            <li><?php printf( '<a href="%s">' . __( 'View your site' ) . '</a>', home_url( '/' ) ); ?></li>
    12761263        </ul>
    12771264    </div>
    12781265    <div class="welcome-panel-column welcome-panel-last">
    1279         <h4><span class="icon16 icon-appearance"></span> <?php _e( 'Customize Your Site' ); ?></h4>
    1280         <?php
    1281         $theme = wp_get_theme();
    1282         if ( $theme->errors() ) :
    1283             echo '<p>';
    1284             printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
    1285             echo '</p>';
    1286         else:
    1287             $customize_links = array();
    1288             if ( 'twentyeleven' == $theme->get_stylesheet() )
    1289                 $customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) );
    1290 
    1291             if ( current_theme_supports( 'custom-background' ) )
    1292                 $customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) );
    1293 
    1294             if ( current_theme_supports( 'custom-header' ) )
    1295                 $customize_links[] = sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) );
    1296 
    1297             if ( current_theme_supports( 'widgets' ) )
    1298                 $customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) );
    1299 
    1300             if ( ! empty( $customize_links ) ) {
    1301                 echo '<p>';
    1302                 printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %1$s, here are a few ways to make your site look unique.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );
    1303                 echo '</p>';
    1304             ?>
    1305             <ul>
    1306                 <?php foreach ( $customize_links as $customize_link ) : ?>
    1307                 <li><?php echo $customize_link ?></li>
    1308                 <?php endforeach; ?>
    1309             </ul>
    1310             <?php
    1311             } else {
    1312                 echo '<p>';
    1313                 printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );
    1314                 echo '</p>';
    1315             }
    1316         endif; ?>
     1266        <h4><?php _e( 'Learn How To' ); ?></h4>
     1267        <ul>
     1268            <li><?php printf( '<a id="wp350_add_images" href="%s">' . __( 'Add image/media' ) . '</a>', admin_url( 'media-new.php' ) ); ?></li>
     1269            <li><?php printf( '<a id="wp350_widgets" href="%s">' . __( 'Add/remove widgets' ) . '</a>', admin_url( 'widgets.php' ) ); ?></li>
     1270            <li><?php printf( '<a id="wp350_edit_menu" href="%s">' . __( 'Edit your navigation menu' ) . '</a>', admin_url( 'nav-menus.php' ) ); ?></li>
     1271        </ul>
    13171272    </div>
    1318     </div>
    1319     <p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?></p>
    13201273    </div>
    13211274    </div>
  • trunk/wp-admin/includes/screen.php

    r21982 r22018  
    938938                    meta_box_prefs( $this );
    939939
    940                     if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) {
     940                    if ( 'dashboard' === $this->id && has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) {
    941941                        if ( isset( $_GET['welcome'] ) ) {
    942942                            $welcome_checked = empty( $_GET['welcome'] ) ? 0 : 1;
  • trunk/wp-admin/index.php

    r21716 r22018  
    107107<h2><?php echo esc_html( $title ); ?></h2>
    108108
    109 <?php wp_welcome_panel(); ?>
     109<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
     110    $classes = 'welcome-panel';
     111
     112    $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
     113    // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
     114    $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
     115    if ( $hide )
     116        $classes .= ' hidden'; ?>
     117
     118    <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
     119        <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
     120        <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
     121        <?php do_action( 'welcome_panel' ); ?>
     122    </div>
     123<?php endif; ?>
    110124
    111125<div id="dashboard-widgets-wrap">
  • trunk/wp-includes/default-filters.php

    r21998 r22018  
    258258add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment'                           );
    259259add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment'                           );
     260add_action( 'welcome_panel',              'wp_welcome_panel'                               );
    260261
    261262// Navigation menu actions
Note: See TracChangeset for help on using the changeset viewer.