WordPress.org

Make WordPress Core

Changeset 26795


Ignore:
Timestamp:
12/08/2013 07:14:00 AM (8 years ago)
Author:
nacin
Message:

About screen: Only show the pick-a-color section if there are 2 or more of the eight new color schemes available. And only show the eight core schemes.

This hides the section in develop.svn /src's directory (use /build for colors) and when a plugin is manipulating/unregistering colors. In both situations, which are rare, losing the section is fine.

This removes a fallback image as we were previously showing the section in these cases; the rest of the page shows off the design (and color opportunities) well enough on its own to avoid this confusing section.

see #26387.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/about.php

    r26788 r26795  
    7676<hr>
    7777
     78<?php
     79global $_wp_admin_css_colors;
     80$new_colors = array( 'fresh', 'light', 'blue', 'midnight', 'sunrise', 'ectoplasm', 'ocean', 'coffee' );
     81$_wp_admin_css_colors = array_intersect_key( $_wp_admin_css_colors, array_fill_keys( $new_colors, true ) );
     82
     83if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
    7884<div class="changelog about-colors">
    7985    <div class="feature-section col one-col">
    8086        <div>
    8187            <h3><?php echo ( 'Pick a color' ); ?></h3>
    82             <p><?php echo ( 'We&#8217;ve included eight color schemes so you can pick your favorite. Choose from any of them below to change it in an instant.' ); ?></p>
    83             <?php $user_id = get_current_user_id(); ?>
    84             <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) :?>
     88            <p><?php echo ( 'We&#8217;ve included eight color schemes so you can pick your favorite. Choose from any of them below to change it in an instant.' ); ?>
    8589                <?php
    8690                /** This action is documented in wp-admin/user-edit.php */
    8791                do_action( 'admin_color_scheme_picker' );
    8892                ?>
    89             <?php else : ?>
    90                 <img src="<?php echo admin_url( 'images/about-color-schemes.png' ); ?>" />
    91             <?php endif; ?>
    92             <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url( $user_id ) ); ?></p>
     93            <p><?php printf( ( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url( get_current_user_id() ) ); ?></p>
    9394        </div>
    9495    </div>
     
    9697
    9798<hr>
     99<?php endif; ?>
    98100
    99101<div class="changelog">
Note: See TracChangeset for help on using the changeset viewer.