Make WordPress Core

Ticket #42778: 42778.2.diff

File 42778.2.diff, 3.3 KB (added by chetan200891, 7 years ago)

Created patch for solution agreed by design team.

  • src/wp-admin/css/widgets.css

    diff --git a/src/wp-admin/css/widgets.css b/src/wp-admin/css/widgets.css
    index a4d314a..c72f048 100644
    a b  
    3636        user-select: none;
    3737}
    3838
     39.widget-access-link {
     40        float: right;
     41        margin: -5px 0 10px 10px;
     42}
     43
    3944.widgets-holder-wrap .widget-inside {
    4045        border-top: none;
    4146        padding: 1px 15px 15px 15px;
    ul.CodeMirror-hints { 
    772777                padding-right: 0;
    773778        }
    774779
     780        .widget-access-link {
     781                float: none;
     782                margin: 15px 0 0 0;
     783        }
     784
    775785        #widgets-left .sidebar-name {
    776786                margin-right: 0;
    777787        }
  • src/wp-admin/includes/class-wp-screen.php

    diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
    index 0277970..c9b6a57 100644
    a b if ( $this->show_screen_options() ) : 
    927927                $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
    928928
    929929                switch ( $this->base ) {
    930                         case 'widgets':
    931                                 $nonce                  = wp_create_nonce( 'widgets-access' );
    932                                 $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=' . urlencode( $nonce ) . '">' . __( 'Enable accessibility mode' ) . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=' . urlencode( $nonce ) . '">' . __( 'Disable accessibility mode' ) . "</a></p>\n";
    933                                 break;
    934930                        case 'post':
    935931                                $expand                 = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
    936932                                $expand                .= '<input type="checkbox" id="editor-expand-toggle"' . checked( get_user_setting( 'editor_expand', 'on' ), 'on', false ) . ' />';
    if ( $this->show_screen_options() ) : 
    943939                }
    944940
    945941                /**
    946                  * Filters the screen settings text displayed in the Screen Options tab.
    947                  *
    948                  * This filter is currently only used on the Widgets screen to enable
    949                  * accessibility mode.
    950                  *
    951                  * @since 3.0.0
    952                  *
    953                  * @param string    $screen_settings Screen settings.
    954                  * @param WP_Screen $this            WP_Screen object.
    955                  */
    956                 $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
    957 
    958                 if ( $this->_screen_settings || $this->_options ) {
    959                         $show_screen = true;
    960                 }
    961 
    962                 /**
    963942                 * Filters whether to show the Screen Options tab.
    964943                 *
    965944                 * @since 3.2.0
  • src/wp-admin/widgets.php

    diff --git a/src/wp-admin/widgets.php b/src/wp-admin/widgets.php
    index 5337670..be3a26b 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    382382echo esc_html( $title );
    383383?>
    384384</h1>
    385 
    386385<?php
    387386if ( current_user_can( 'customize' ) ) {
    388387        printf(
    if ( current_user_can( 'customize' ) ) { 
    400399        );
    401400}
    402401?>
    403 
     402<?php $nonce = wp_create_nonce( 'widgets-access' ); ?>
     403<div class="widget-access-link">
     404        <a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Enable accessibility mode' ); ?></a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Disable accessibility mode' ); ?></a>
     405</div>
    404406<hr class="wp-header-end">
    405407
    406408<?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?>