PluginProbe
Polylang / 3.7.7
Polylang v3.7.7
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-languages.php +11 -11 3.03.7.7 View file →
@@ -67,10 +67,12 @@
67 67 case 'slug':
68 68 return esc_html( $item->$column_name );
69 69
70 70 case 'term_group':
71 + return (int) $item->$column_name;
72 +
71 73 case 'count':
72 - return (int) $item->$column_name;
74 + return $item->get_tax_prop( 'language', $column_name );
73 75
74 76 default:
75 77 return $item->$column_name; // Flag.
76 78 }
@@ -103,11 +105,9 @@
103 105 * @param PLL_Language $item The language item.
104 106 * @return string
105 107 */
106 108 public function column_default_lang( $item ) {
107 - $options = get_option( 'polylang' );
108 -
109 - if ( $options['default_lang'] != $item->slug ) {
109 + if ( ! $item->is_default ) {
110 110 $s = sprintf(
111 111 '<div class="row-actions"><span class="default-lang">
112 112 <a class="icon-default-lang" title="%1$s" href="%2$s"><span class="screen-reader-text">%3$s</span></a>
113 113 </span></div>',
@@ -228,14 +228,14 @@
228 228 return $this->row_actions( $actions );
229 229 }
230 230
231 231 /**
232 - * Sort items
232 + * Sorts language items.
233 233 *
234 234 * @since 0.1
235 235 *
236 - * @param object $a The first object to compare
237 - * @param object $b The second object to compare
236 + * @param PLL_Language $a The first language to compare.
237 + * @param PLL_Language $b The second language to compare.
238 238 * @return int -1 or 1 if $a is considered to be respectively less than or greater than $b.
239 239 */
240 240 protected function usort_reorder( $a, $b ) {
241 241 $orderby = ! empty( $_GET['orderby'] ) ? sanitize_key( $_GET['orderby'] ) : 'name'; // phpcs:ignore WordPress.Security.NonceVerification
@@ -244,18 +244,18 @@
244 244 $result = $a->$orderby > $b->$orderby ? 1 : -1;
245 245 } else {
246 246 $result = strcmp( $a->$orderby, $b->$orderby );
247 247 }
248 - // Send final sort direction to usort
248 + // Send final sort direction to usort.
249 249 return ( empty( $_GET['order'] ) || 'asc' === $_GET['order'] ) ? $result : -$result; // phpcs:ignore WordPress.Security.NonceVerification
250 250 }
251 251
252 252 /**
253 - * Prepares the list of items for displaying
253 + * Prepares the list of languages for display.
254 254 *
255 255 * @since 0.1
256 256 *
257 - * @param array $data
257 + * @param PLL_Language[] $data The list of languages.
258 258 * @return void
259 259 */
260 260 public function prepare_items( $data = array() ) {
261 261 $per_page = $this->get_items_per_page( 'pll_lang_per_page' );
@@ -269,9 +269,9 @@
269 269 $this->set_pagination_args(
270 270 array(
271 271 'total_items' => $total_items,
272 272 'per_page' => $per_page,
273 - 'total_pages' => ceil( $total_items / $per_page ),
273 + 'total_pages' => (int) ceil( $total_items / $per_page ),
274 274 )
275 275 );
276 276 }
277 277 }