Handle themes that have no customization screens. fixes #19408
git-svn-id: http://svn.automattic.com/wordpress/trunk@19545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b000d19be4
commit
fe9de5f4a4
|
@ -1321,34 +1321,36 @@ function wp_welcome_panel() {
|
||||||
echo '<p>';
|
echo '<p>';
|
||||||
printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
|
printf( __( '<a href="%s">Install a theme</a> to get started customizing your site.' ), esc_url( admin_url( 'themes.php' ) ) );
|
||||||
echo '</p>';
|
echo '</p>';
|
||||||
else:
|
else:
|
||||||
echo '<p>';
|
$customize_links = array();
|
||||||
printf( __( 'Use the current theme — %1$s — 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 );
|
if ( 'twentyeleven' == $ct->stylesheet )
|
||||||
echo '</p>';
|
$customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) );
|
||||||
|
|
||||||
|
if ( current_theme_supports( 'custom-background' ) )
|
||||||
|
$customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) );
|
||||||
|
|
||||||
|
if ( current_theme_supports( 'custom-header' ) )
|
||||||
|
$customize_links[] = sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) );
|
||||||
|
|
||||||
|
if ( current_theme_supports( 'widgets' ) )
|
||||||
|
$customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) );
|
||||||
|
|
||||||
|
if ( ! empty( $customize_links ) ) {
|
||||||
|
echo '<p>';
|
||||||
|
printf( __( 'Use the current theme — %1$s — 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 );
|
||||||
|
echo '</p>';
|
||||||
?>
|
?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php foreach ( $customize_links as $customize_link ) : ?>
|
||||||
if ( 'twentyeleven' == $ct->stylesheet ) : ?>
|
<li><?php echo $customize_link ?></li>
|
||||||
<li><?php echo sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ); ?></li>
|
<?php endforeach; ?>
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( current_theme_supports( 'custom-background' ) ) : ?>
|
|
||||||
<li><?php echo sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) ); ?></li>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( current_theme_supports( 'custom-header' ) ) : ?>
|
|
||||||
<li><?php echo sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) ); ?></li>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( current_theme_supports( 'widgets' ) ) : ?>
|
|
||||||
<li><?php echo sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) ); ?></li>
|
|
||||||
<?php
|
|
||||||
endif; ?>
|
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
|
} else {
|
||||||
|
echo '<p>';
|
||||||
|
printf( __( 'Use the current theme — %1$s — or <a href="%2$s">choose a new one</a>.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ) );
|
||||||
|
echo '</p>';
|
||||||
|
}
|
||||||
endif; ?>
|
endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue