Make WordPress Core


Ignore:
Timestamp:
09/26/2012 07:44:43 PM (12 years ago)
Author:
nacin
Message:

New design and content for the welcome panel. First pass.

props lessbloat, helenyhou, georgestephanis, sabreuse, ryelle.
see #21368.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/index.php

    r21716 r22018  
    107107<h2><?php echo esc_html( $title ); ?></h2>
    108108
    109 <?php wp_welcome_panel(); ?>
     109<?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
     110    $classes = 'welcome-panel';
     111
     112    $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
     113    // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
     114    $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
     115    if ( $hide )
     116        $classes .= ' hidden'; ?>
     117
     118    <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
     119        <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
     120        <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
     121        <?php do_action( 'welcome_panel' ); ?>
     122    </div>
     123<?php endif; ?>
    110124
    111125<div id="dashboard-widgets-wrap">
Note: See TracChangeset for help on using the changeset viewer.