Make WordPress Core

Changeset 19545


Ignore:
Timestamp:
12/02/2011 08:48:47 PM (15 years ago)
Author:
ryan
Message:

Handle themes that have no customization screens. fixes #19408

File:
1 edited

Legend:

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

    r19528 r19545  
    13221322                        printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
    13231323                        echo '</p>';
    1324                         else:
    1325                         echo '<p>';
    1326                         printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %3$s, here are a few ways to make your site look unique.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ), $ct->title );
    1327                         echo '</p>';
     1324                else:
     1325                        $customize_links = array();
     1326                        if ( 'twentyeleven' == $ct->stylesheet )
     1327                                $customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) );
     1328
     1329                        if ( current_theme_supports( 'custom-background' ) )
     1330                                $customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) );
     1331
     1332                        if ( current_theme_supports( 'custom-header' ) )
     1333                                $customize_links[] = sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) );
     1334
     1335                        if ( current_theme_supports( 'widgets' ) )
     1336                                $customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) );
     1337
     1338                        if ( ! empty( $customize_links ) ) {
     1339                                echo '<p>';
     1340                                printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %3$s, here are a few ways to make your site look unique.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ), $ct->title );
     1341                                echo '</p>';
    13281342                        ?>
    13291343                        <ul>
     1344                                <?php foreach ( $customize_links as $customize_link ) : ?>
     1345                                <li><?php echo $customize_link ?></li>
     1346                                <?php endforeach; ?>
     1347                        </ul>
    13301348                        <?php
    1331                         if ( 'twentyeleven' == $ct->stylesheet ) : ?>
    1332                                 <li><?php echo sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ); ?></li>
    1333                         <?php
    1334                         endif;
    1335 
    1336                         if ( current_theme_supports( 'custom-background' ) ) : ?>
    1337                                 <li><?php echo sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) ); ?></li>
    1338                         <?php
    1339                         endif;
    1340 
    1341                         if ( current_theme_supports( 'custom-header' ) ) : ?>
    1342                                 <li><?php echo sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) ); ?></li>
    1343                         <?php
    1344                         endif;
    1345 
    1346                         if ( current_theme_supports( 'widgets' ) ) : ?>
    1347                                 <li><?php echo sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) ); ?></li>
    1348                         <?php
    1349                         endif; ?>
    1350                         </ul>
    1351                 <?php
     1349                        } else {
     1350                                echo '<p>';
     1351                                printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ) );
     1352                                echo '</p>';
     1353                        }
    13521354                endif; ?>
    13531355        </div>
Note: See TracChangeset for help on using the changeset viewer.