Skip to content

Commit

Permalink
Coding Standards: Use self when appropriate.
Browse files Browse the repository at this point in the history
* `WP_List_Table::get_default_primary_column_name()` is a protected method, so calling it statically with the class name is bad practice.
* Similarly, this applies when calling a private constructor in `WP_Screen::get()`.

Props jrf.
See #50767.

git-svn-id: https://develop.svn.wordpress.org/trunk@49192 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Oct 18, 2020
1 parent f41b6b4 commit f124a65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-list-table.php
Expand Up @@ -1073,7 +1073,7 @@ protected function get_primary_column_name() {
// If the primary column doesn't exist,
// fall back to the first non-checkbox column.
if ( ! isset( $columns[ $default ] ) ) {
$default = WP_List_Table::get_default_primary_column_name();
$default = self::get_default_primary_column_name();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-screen.php
Expand Up @@ -377,7 +377,7 @@ public static function get( $hook_name = '' ) {
return $screen;
}
} else {
$screen = new WP_Screen();
$screen = new self();
$screen->id = $id;
}

Expand Down

0 comments on commit f124a65

Please sign in to comment.