Make WordPress Core

Ticket #40331: 40331.media-plugins.diff

File 40331.media-plugins.diff, 7.1 KB (added by joedolson, 15 months ago)

Patch removing placeholders in media library and plugins search

  • src/js/media/views/attachments/browser.js

     
    378378                }
    379379
    380380                if ( this.options.search ) {
    381                         // Search is an input, a visually hidden label element needs to be rendered before.
     381                        // Search is an input, a label element needs to be rendered before.
    382382                        this.toolbar.set( 'searchLabel', new wp.media.view.Label({
    383383                                value: l10n.searchLabel,
    384384                                className: 'media-search-input-label',
  • src/wp-admin/css/common.css

     
    10901090
    10911091.wp-filter .search-form {
    10921092        float: right;
    1093         margin: 10px 0;
     1093        display: flex;
     1094        align-items: center;
     1095        column-gap: .5rem;
    10941096}
    10951097
    10961098.wp-filter .search-form input[type="search"] {
     
    11191121.wp-filter .search-form.search-plugins .wp-filter-search,
    11201122.no-js .wp-filter .search-form.search-plugins .button {
    11211123        display: inline-block;
    1122         margin-top: 10px;
    11231124        vertical-align: top;
    11241125}
    11251126
     
    13601361                position: relative;
    13611362                max-width: 100%;
    13621363        }
     1364        .wp-filter .search-form {
     1365                margin: 11px 0;
     1366                flex-wrap: wrap;
     1367                row-gap: 10px;
     1368        }
    13631369}
    13641370
    13651371@media only screen and (max-width: 782px) {
     
    41234129        }
    41244130
    41254131        .wp-filter .search-form input[type="search"] {
    4126                 width: 100%;
    41274132                font-size: 1rem;
    41284133        }
    41294134
  • src/wp-admin/css/forms.css

     
    720720}
    721721
    722722p.search-box {
     723        display: flex;
     724        flex-wrap: wrap;
     725        align-items: center;
     726        column-gap: .5rem;
     727        position: relative;
    723728        float: right;
    724         margin: 0;
     729        margin: 11px 0;
    725730}
    726731
    727732.network-admin.themes-php p.search-box {
  • src/wp-admin/css/media.css

     
    581581}
    582582
    583583.media-frame-content .media-search-input-label {
    584         margin: 0 .2em 0 0;
    585584        vertical-align: baseline;
    586585}
    587586
    588 .media-frame.mode-grid .media-search-input-label {
    589         position: static;
    590         margin: 0 .5em 0 0;
    591 }
    592 
    593587.attachments-browser .media-toolbar-secondary > .media-button {
    594588        margin-right: 10px;
    595589}
     
    13691363                width: 100%;
    13701364                margin-bottom: 20px;
    13711365                display: flex;
     1366                flex-wrap: nowrap;
     1367                column-gap: 0px;
    13721368        }
    13731369
     1370        .wp-filter p.search-box #media-search-input {
     1371                width: 100%;
     1372        }
     1373
    13741374}
    13751375
    13761376@media only screen and (max-width: 782px) {
  • src/wp-admin/includes/class-wp-plugins-list-table.php

     
    452452                }
    453453                ?>
    454454                <p class="search-box">
    455                         <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
    456                         <input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>" />
     455                        <label for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?></label>
     456                        <input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" />
    457457                        <?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?>
    458458                </p>
    459459                <?php
  • src/wp-admin/includes/plugin-install.php

     
    320320        ?>
    321321        <form class="search-form search-plugins" method="get">
    322322                <input type="hidden" name="tab" value="search" />
     323                <label for="search-plugins"><?php _e( 'Search Plugins' ); ?></label>
     324                <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" />
    323325                <label class="screen-reader-text" for="typeselector">
    324326                        <?php
    325327                        /* translators: Hidden accessibility text. */
     
    331333                        <option value="author"<?php selected( 'author', $type ); ?>><?php _e( 'Author' ); ?></option>
    332334                        <option value="tag"<?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Plugin Installer' ); ?></option>
    333335                </select>
    334                 <label class="screen-reader-text" for="search-plugins">
    335                         <?php
    336                         /* translators: Hidden accessibility text. */
    337                         _e( 'Search Plugins' );
    338                         ?>
    339                 </label>
    340                 <input type="search" name="s" id="search-plugins" value="<?php echo esc_attr( $term ); ?>" class="wp-filter-search" placeholder="<?php esc_attr_e( 'Search plugins...' ); ?>" />
    341336                <?php submit_button( __( 'Search Plugins' ), 'hide-if-js', false, false, array( 'id' => 'search-submit' ) ); ?>
    342337        </form>
    343338        <?php
  • src/wp-admin/plugins.php

     
    788788<?php $wp_list_table->views(); ?>
    789789
    790790<form class="search-form search-plugins" method="get">
    791 <?php $wp_list_table->search_box( __( 'Search Installed Plugins' ), 'plugin' ); ?>
     791<?php $wp_list_table->search_box( __( 'Search installed plugins' ), 'plugin' ); ?>
    792792</form>
    793793
    794794<form method="post" id="bulk-action-form">
  • src/wp-includes/css/media-views.css

     
    12081208        display: flex;
    12091209        align-items: center;
    12101210        column-gap: .5rem;
     1211        margin: 11px 0;
    12111212}
    12121213
    12131214.mode-grid .attachments-browser .media-toolbar-mode-select .media-toolbar-primary {
     
    27972798        }
    27982799
    27992800        .mode-grid .attachments-browser .media-toolbar-primary {
    2800                 display: flex;
     2801                display: grid;
     2802                grid-template-columns: auto 1fr;
    28012803        }
    28022804
    28032805        .mode-grid .attachments-browser .media-toolbar-primary input[type="search"] {
  • src/wp-includes/media.php

     
    48154815                'apply'                       => __( 'Apply' ),
    48164816                'filterByDate'                => __( 'Filter by date' ),
    48174817                'filterByType'                => __( 'Filter by type' ),
    4818                 'searchLabel'                 => __( 'Search' ),
     4818                'searchLabel'                 => __( 'Search media' ),
    48194819                'searchMediaLabel'            => __( 'Search media' ),          // Backward compatibility pre-5.3.
    48204820                'searchMediaPlaceholder'      => __( 'Search media items...' ), // Placeholder (no ellipsis), backward compatibility pre-5.3.
    48214821                /* translators: %d: Number of attachments found in a search. */