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.

Built from https://develop.svn.wordpress.org/trunk@26795


git-svn-id: http://core.svn.wordpress.org/trunk@26682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-12-08 07:14:10 +00:00
parent cb24a671ef
commit 7b3910917d
1 changed files with 9 additions and 7 deletions

View File

@ -75,26 +75,28 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<hr> <hr>
<?php
global $_wp_admin_css_colors;
$new_colors = array( 'fresh', 'light', 'blue', 'midnight', 'sunrise', 'ectoplasm', 'ocean', 'coffee' );
$_wp_admin_css_colors = array_intersect_key( $_wp_admin_css_colors, array_fill_keys( $new_colors, true ) );
if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<div class="changelog about-colors"> <div class="changelog about-colors">
<div class="feature-section col one-col"> <div class="feature-section col one-col">
<div> <div>
<h3><?php echo ( 'Pick a color' ); ?></h3> <h3><?php echo ( 'Pick a color' ); ?></h3>
<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> <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.' ); ?>
<?php $user_id = get_current_user_id(); ?>
<?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) :?>
<?php <?php
/** This action is documented in wp-admin/user-edit.php */ /** This action is documented in wp-admin/user-edit.php */
do_action( 'admin_color_scheme_picker' ); do_action( 'admin_color_scheme_picker' );
?> ?>
<?php else : ?> <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>
<img src="<?php echo admin_url( 'images/about-color-schemes.png' ); ?>" />
<?php endif; ?>
<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>
</div> </div>
</div> </div>
</div> </div>
<hr> <hr>
<?php endif; ?>
<div class="changelog"> <div class="changelog">
<div class="feature-section col two-col"> <div class="feature-section col two-col">