WordPress.org

Make WordPress Core

Ticket #24716: move_view_switcher_to_left.patch

File move_view_switcher_to_left.patch, 2.4 KB (added by robertburnfield, 4 years ago)

Patch to move the view switcher in the list view to the left to match what is being displayed in the new grid view. Not tested for rtl languages.

  • wp-admin/css/list-tables-rtl.css

     
    614614}
    615615
    616616.view-switch {
    617         float: left;
     617        float: right;
    618618        margin: 5px 8px 0 16px;
    619619}
    620620
  • wp-admin/css/list-tables.css

     
    614614}
    615615
    616616.view-switch {
    617         float: right;
     617    float:left;
    618618        margin: 5px 16px 0 8px;
    619619}
    620620
  • wp-admin/includes/class-wp-list-table.php

     
    896896                        wp_nonce_field( 'bulk-' . $this->_args['plural'] );
    897897?>
    898898        <div class="tablenav <?php echo esc_attr( $which ); ?>">
     899                <?php
     900                $this->pre_bulk_actions( $which ); ?>
    899901
    900902                <div class="alignleft actions bulkactions">
    901903                        <?php $this->bulk_actions(); ?>
     
    10501052
    10511053                printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
    10521054        }
     1055
     1056        /**
     1057         * Perform any actions or inject additional html before the bulk actions
     1058         * @param string $which Top or bottom
     1059         * @since 4.0
     1060         * @access protected
     1061         */
     1062        protected function pre_bulk_actions( $which ) {
     1063
     1064        }
    10531065}
  • wp-admin/includes/class-wp-media-list-table.php

     
    11<?php
     2
    23/**
    34 * Media Library List Table class.
    45 *
     
    106107<?php
    107108        }
    108109
     110        /**
     111         * Inserting view switcher before the bulk actions
     112         * @param string $which Top or bottom
     113         * @since 4.0
     114         * @access protected
     115         */
     116        protected function pre_bulk_actions( $which ) {
     117                global $mode;
     118                $this->view_switcher( $mode );
     119        }
     120
    109121        public function current_action() {
    110122                if ( isset( $_REQUEST['find_detached'] ) )
    111123                        return 'find_detached';
     
    127139                _e( 'No media attachments found.' );
    128140        }
    129141
    130         protected function pagination( $which ) {
    131                 global $mode;
    132 
    133                 parent::pagination( $which );
    134 
    135                 $this->view_switcher( $mode );
    136         }
    137 
    138142        /**
    139143         * Display a view switcher
    140144         *