Make WordPress Core


Ignore:
Timestamp:
11/23/2011 06:30:45 PM (13 years ago)
Author:
nacin
Message:

Change show/hide storage mechanism for show_welcome_panel. 0 = hide, 1 = show, 2 = show if the multisite owner. Make welcome panel dismissable without JS (openable too via the URL). fixes #19338, fixes #19127.

File:
1 edited

Legend:

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

    r19363 r19418  
    12771277    $classes = 'welcome-panel';
    12781278
    1279     if ( ! get_user_option( 'show_welcome_panel' ) )
     1279    $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
     1280    // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
     1281    $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
     1282    if ( $hide )
    12801283        $classes .= ' hidden';
    12811284
     
    12841287    <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
    12851288    <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
    1286     <a class="welcome-panel-close" href="#"><?php _e('Dismiss'); ?></a>
     1289    <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e('Dismiss'); ?></a>
    12871290    <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    12881291
     
    13501353    </div>
    13511354    </div>
    1352     <p class="welcome-panel-dismiss"><?php _e( 'Already know what you&#8217;re doing? <a href="#">Dismiss this message</a>.' ); ?></p>
     1355    <p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( admin_url( '?welcome=0' ) ) ); ?></p>
    13531356    </div>
    13541357    </div>
Note: See TracChangeset for help on using the changeset viewer.