WordPress.org

Make WordPress Core

Ticket #19338: 19338.002.diff

File 19338.002.diff, 2.1 KB (added by duck_, 3 years ago)

To line up with latest patch (.3.diff) on #19127

  • wp-admin/includes/dashboard.php

     
    138138                exit; 
    139139        } 
    140140 
     141        if ( isset( $_GET['action'] ) && 'dismiss-welcome-panel' == $_GET['action'] ) { 
     142                if ( current_user_can( 'edit_theme_options' ) ) 
     143                        update_user_meta( get_current_user_id(), 'show_welcome_panel', 0 ); 
     144        } 
     145 
    141146        if ( $update ) 
    142147                update_option( 'dashboard_widget_options', $widget_options ); 
    143148 
     
    12831288        ?> 
    12841289        <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>"> 
    12851290        <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?> 
    1286         <a class="welcome-panel-close" href="#"><?php _e('Dismiss'); ?></a> 
     1291        <a class="welcome-panel-close" href="<?php echo esc_url( add_query_arg( 'action', 'dismiss-welcome-panel', admin_url( 'index.php' ) ) ); ?>"><?php _e( 'Dismiss' ); ?></a> 
    12871292        <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> 
    12881293 
    12891294        <div class="welcome-panel-content"> 
     
    13491354                endif; ?> 
    13501355        </div> 
    13511356        </div> 
    1352         <p class="welcome-panel-dismiss"><?php _e( 'Already know what you&#8217;re doing? <a href="#">Dismiss this message</a>.' ); ?></p> 
     1357        <p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), esc_url( add_query_arg( 'action', 'dismiss-welcome-panel', admin_url( 'index.php' ) ) ) ); ?></p> 
    13531358        </div> 
    13541359        </div> 
    13551360        <?php 
  • wp-admin/js/dashboard.dev.js

     
    1515        if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) 
    1616                welcomePanel.removeClass('hidden'); 
    1717 
    18         $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function() { 
     18        $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) { 
     19                e.preventDefault(); 
    1920                welcomePanel.addClass('hidden'); 
    2021                updateWelcomePanel( 0 ); 
    2122                $('#wp_welcome_panel-hide').prop('checked', false);