Make WordPress Core


Ignore:
Timestamp:
05/05/2011 08:15:19 PM (15 years ago)
Author:
ryan
Message:

Custom header admin UI fixes. Props lancewillett. fixes #17240

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r17773 r17814  
    258258         */
    259259        function show_header_selector( $type = 'default' ) {
    260                 echo '<div id="available-headers">';
    261260                if ( 'default' == $type ) {
    262261                        $headers = $this->default_headers;
     
    266265                }
    267266
     267                if ( 1 < count( $headers ) ) {
     268                        echo '<div class="random-header">';
     269                        echo '<label><input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';
     270                        echo __( '<strong>Random:</strong> Show a different image on each page.' );
     271                        echo '</label>';
     272                        echo '</div>';
     273                }
     274
     275                echo '<div class="available-headers">';
    268276                foreach ( $headers as $header_key => $header ) {
    269277                        $header_thumbnail = $header['thumbnail_url'];
     
    276284                                $width = ' width="230"';
    277285                        echo '<img src="' . $header_thumbnail . '" alt="' . esc_attr( $header_desc ) .'" title="' . esc_attr( $header_desc ) . '"' . $width . ' /></label>';
    278                         echo '</div>';
    279                 }
    280                 if ( 1 < count( $headers ) ) {
    281                         echo '<div class="default-header">';
    282                         echo '<label><input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';
    283                         echo __( '<strong>Random:</strong> Show a different image on each page.' );
    284                         echo '</label>';
    285286                        echo '</div>';
    286287                }
     
    524525<th scope="row"><?php _e( 'Uploaded Images' ); ?></th>
    525526<td>
    526         <p><?php _e( 'You can use one of your previously uploaded headers.' ) ?></p>
     527        <p><?php _e( 'You can choose one of your previously uploaded headers, or show a random one.' ) ?></p>
    527528        <?php
    528529                $this->show_header_selector( 'uploaded' );
     
    536537<td>
    537538<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
    538         <p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers.' ) ?></p>
     539        <p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ) ?></p>
    539540<?php else: ?>
    540         <p><?php _e( 'You can use one of these cool headers.' ) ?>
     541        <p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ) ?></p>
    541542<?php endif; ?>
    542543        <?php
Note: See TracChangeset for help on using the changeset viewer.