PluginProbe
Polylang / 2.5.2
Polylang v2.5.2
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | settings/table-settings.php +14 -22 2.92.5.2 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 if ( ! class_exists( 'WP_List_Table' ) ) {
7 4 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; // since WP 3.1
8 5 }
@@ -61,9 +58,9 @@
61 58 printf(
62 59 '<tr class="plugin-update-tr">
63 60 <td colspan="3" class="plugin-update colspanchange">%s</td>
64 61 </tr>',
65 - sprintf( '<div class="update-message notice inline notice-warning notice-alt"><p>%s</p></div>', $message ) // phpcs:ignore WordPress.Security.EscapeOutput
62 + sprintf( '<div class="update-message notice inline notice-warning notice-alt"><p>%s</p></div>', $message )
66 63 );
67 64 }
68 65
69 66 // The settings if there are
@@ -80,10 +77,10 @@
80 77 </td>
81 78 </tr>',
82 79 esc_attr( $item->module ),
83 80 esc_html( $item->title ),
84 - $form, // phpcs:ignore
85 - implode( $item->get_buttons() ) // phpcs:ignore
81 + $form,
82 + implode( $item->get_buttons() )
86 83 );
87 84 }
88 85 }
89 86
@@ -94,25 +91,28 @@
94 91 *
95 92 * @param object $item The current item
96 93 */
97 94 protected function single_row_columns( $item ) {
98 - $column_info = $this->get_column_info();
99 - $columns = $column_info[0];
100 - $primary = $column_info[3];
95 + list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
101 96
102 - foreach ( array_keys( $columns ) as $column_name ) {
97 + foreach ( $columns as $column_name => $column_display_name ) {
103 98 $classes = "$column_name column-$column_name";
104 99 if ( $primary === $column_name ) {
105 100 $classes .= ' column-primary';
106 101 }
107 102
103 + if ( in_array( $column_name, $hidden ) ) {
104 + $classes .= ' hidden';
105 + }
106 +
108 107 if ( 'cb' == $column_name ) {
109 108 echo '<th scope="row" class="check-column">';
110 - echo $this->column_cb( $item ); // phpcs:ignore WordPress.Security.EscapeOutput
109 + echo $this->column_cb( $item );
111 110 echo '</th>';
112 - } else {
111 + }
112 + else {
113 113 printf( '<td class="%s">', esc_attr( $classes ) );
114 - echo $this->column_default( $item, $column_name ); // phpcs:ignore WordPress.Security.EscapeOutput
114 + echo $this->column_default( $item, $column_name );
115 115 echo '</td>';
116 116 }
117 117 }
118 118 }
@@ -167,16 +167,8 @@
167 167 * @param array $items
168 168 */
169 169 public function prepare_items( $items = array() ) {
170 170 $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns(), $this->get_primary_column_name() );
171 -
172 - // Sort rows, lowest priority on top.
173 - usort(
174 - $items,
175 - function( $a, $b ) {
176 - return $a->priority > $b->priority ? 1 : -1;
177 - }
178 - );
179 171 $this->items = $items;
180 172 }
181 173
182 174 /**
@@ -185,6 +177,6 @@
185 177 * @since 2.1
186 178 *
187 179 * @param string $which 'top' or 'bottom'
188 180 */
189 - protected function display_tablenav( $which ) {} // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
181 + protected function display_tablenav( $which ) {}
190 182 }