Skip to content

Commit 493ce1a

Browse files
Fix linting
1 parent a6be580 commit 493ce1a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

projects/packages/stats-admin/src/class-admin-post-list-column.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
*/
1919
class Admin_Post_List_Column {
2020

21+
/**
22+
* Create the object.
23+
*
24+
* @return self
25+
*/
26+
public static function register() {
27+
return new self();
28+
}
2129
/**
2230
* The constructor.
2331
*/
@@ -152,11 +160,6 @@ public function add_stats_post_table( $columns ) {
152160
$pos = count( $columns );
153161
}
154162

155-
// Final fallback, if the array was malformed by another plugin for example.
156-
if ( ! is_int( $pos ) ) {
157-
return $columns;
158-
}
159-
160163
$chunks = array_chunk( $columns, $pos, true );
161164
$chunks[0]['stats'] = esc_html__( 'Stats', 'jetpack-stats-admin' );
162165

projects/packages/stats-admin/src/class-main.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function ( $show, $screen_id ) {
6666
2
6767
);
6868

69-
new Admin_Post_List_Column();
69+
Admin_Post_List_Column::register();
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)