Customize: Prevent PHP notice on theme-switch dashboard welcome link (and link to themes admin screen) when user cannot `customize`.

Props skostadinov, ocean90.
Amends [41699].
See #42050.
Fixes #42525.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-11-13 22:45:11 +00:00
parent 2f95f44008
commit 609c0db668
2 changed files with 4 additions and 4 deletions

View File

@ -1567,14 +1567,14 @@ function wp_welcome_panel() {
<p class="about-description"><?php _e( 'We&#8217;ve assembled some links to get you started:' ); ?></p>
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<?php if ( current_user_can( 'customize' ) ):
$customize_themes_link = add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ); ?>
<?php if ( current_user_can( 'customize' ) ) : ?>
<h3><?php _e( 'Get Started' ); ?></h3>
<a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo wp_customize_url(); ?>"><?php _e( 'Customize Your Site' ); ?></a>
<?php endif; ?>
<a class="button button-primary button-hero hide-if-customize" href="<?php echo admin_url( 'themes.php' ); ?>"><?php _e( 'Customize Your Site' ); ?></a>
<?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?>
<p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $customize_themes_link ); ?></p>
<?php $themes_link = current_user_can( 'customize' ) ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>
<p class="hide-if-no-customize"><?php printf( __( 'or, <a href="%s">change your theme completely</a>' ), $themes_link ); ?></p>
<?php endif; ?>
</div>
<div class="welcome-panel-column">

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42165';
$wp_version = '5.0-alpha-42169';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.