Changeset 52279 for trunk/src/wp-admin/includes/dashboard.php
- Timestamp:
- 11/30/2021 02:25:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/dashboard.php
r52204 r52279 1988 1988 * 1989 1989 * @since 3.3.0 1990 * @since 5.9.0 Send users to the Site Editor if the current theme is block-based. 1990 1991 */ 1991 1992 function wp_welcome_panel() { 1993 $customize_url = null; 1994 $can_edit_theme_options = current_user_can( 'edit_theme_options' ); 1995 $can_customize = current_user_can( 'customize' ); 1996 $is_block_based_theme = wp_is_block_template_theme(); 1997 1998 if ( $is_block_based_theme && $can_edit_theme_options ) { 1999 $customize_url = esc_url( admin_url( 'site-editor.php' ) ); 2000 } elseif ( ! $is_block_based_theme && $can_customize ) { 2001 $customize_url = wp_customize_url(); 2002 } 1992 2003 ?> 1993 2004 <div class="welcome-panel-content"> … … 1996 2007 <div class="welcome-panel-column-container"> 1997 2008 <div class="welcome-panel-column"> 1998 <?php if ( current_user_can( 'customize' )) : ?>2009 <?php if ( $customize_url ) : ?> 1999 2010 <h3><?php _e( 'Get Started' ); ?></h3> 2000 <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>2011 <a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo $customize_url; ?>"><?php _e( 'Customize Your Site' ); ?></a> 2001 2012 <?php endif; ?> 2002 2013 <a class="button button-primary button-hero hide-if-customize" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>"><?php _e( 'Customize Your Site' ); ?></a> 2003 2014 <?php if ( current_user_can( 'install_themes' ) || ( current_user_can( 'switch_themes' ) && count( wp_get_themes( array( 'allowed' => true ) ) ) > 1 ) ) : ?> 2004 <?php $themes_link = current_user_can( 'customize' )? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?>2015 <?php $themes_link = $can_customize && ! $is_block_based_theme ? add_query_arg( 'autofocus[panel]', 'themes', admin_url( 'customize.php' ) ) : admin_url( 'themes.php' ); ?> 2005 2016 <p class="hide-if-no-customize"> 2006 2017 <?php
Note: See TracChangeset
for help on using the changeset viewer.