PluginProbe
Polylang / 2.7.3
Polylang v2.7.3
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 +12 -27 3.02.7.3 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 }
@@ -37,14 +34,13 @@
37 34 return array( 'wp-list-table', 'widefat', 'plugins', 'pll-settings' ); // get the style of the plugins list table + one specific class
38 35 }
39 36
40 37 /**
41 - * Displays a single row.
38 + * Displays a single row
42 39 *
43 40 * @since 1.8
44 41 *
45 - * @param PLL_Settings_Module $item Settings module item.
46 - * @return void
42 + * @param object $item PLL_Settings_Module object
47 43 */
48 44 public function single_row( $item ) {
49 45 // Classes to reuse css from the plugins list table
50 46 $classes = $item->is_active() ? 'active' : 'inactive';
@@ -88,14 +84,13 @@
88 84 }
89 85 }
90 86
91 87 /**
92 - * Generates the columns for a single row of the table.
88 + * Generates the columns for a single row of the table
93 89 *
94 90 * @since 1.8
95 91 *
96 - * @param PLL_Settings_Module $item Settings module item.
97 - * @return void
92 + * @param object $item The current item
98 93 */
99 94 protected function single_row_columns( $item ) {
100 95 $column_info = $this->get_column_info();
101 96 $columns = $column_info[0];
@@ -119,15 +114,15 @@
119 114 }
120 115 }
121 116
122 117 /**
123 - * Displays the item information in a column (default case).
118 + * Displays the item information in a column ( default case )
124 119 *
125 120 * @since 1.8
126 121 *
127 - * @param PLL_Settings_Module $item Settings module item.
128 - * @param string $column_name Column name.
129 - * @return string The column name.
122 + * @param object $item
123 + * @param string $column_name
124 + * @return string
130 125 */
131 126 protected function column_default( $item, $column_name ) {
132 127 if ( 'plugin-title' == $column_name ) {
133 128 return sprintf( '<strong>%s</strong>', esc_html( $item->title ) ) . $this->row_actions( $item->get_action_links(), true /*always visible*/ );
@@ -135,13 +130,13 @@
135 130 return $item->$column_name;
136 131 }
137 132
138 133 /**
139 - * Gets the list of columns.
134 + * Gets the list of columns
140 135 *
141 136 * @since 1.8
142 137 *
143 - * @return string[] The list of column titles.
138 + * @return array the list of column titles
144 139 */
145 140 public function get_columns() {
146 141 return array(
147 142 'cb' => '', // For the 4px border inherited from plugins when the module is activated
@@ -165,21 +160,12 @@
165 160 * Prepares the list of items for displaying
166 161 *
167 162 * @since 1.8
168 163 *
169 - * @param PLL_Settings_Module[] $items Array of settings module items.
170 - * @return void
164 + * @param array $items
171 165 */
172 166 public function prepare_items( $items = array() ) {
173 167 $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns(), $this->get_primary_column_name() );
174 -
175 - // Sort rows, lowest priority on top.
176 - usort(
177 - $items,
178 - function( $a, $b ) {
179 - return $a->priority > $b->priority ? 1 : -1;
180 - }
181 - );
182 168 $this->items = $items;
183 169 }
184 170
185 171 /**
@@ -187,8 +173,7 @@
187 173 *
188 174 * @since 2.1
189 175 *
190 176 * @param string $which 'top' or 'bottom'
191 - * @return void
192 177 */
193 - protected function display_tablenav( $which ) {} // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
178 + protected function display_tablenav( $which ) {}
194 179 }