From f124a650ba9312f702e0e44f06cee6bca08341b2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 18 Oct 2020 17:16:33 +0000 Subject: [PATCH] Coding Standards: Use `self` when appropriate. * `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 --- src/wp-admin/includes/class-wp-list-table.php | 2 +- src/wp-admin/includes/class-wp-screen.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 8ccd02998fd4..2ef5f8d1b9a6 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -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(); } /** diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 57077ed299d2..9464fabe0573 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -377,7 +377,7 @@ public static function get( $hook_name = '' ) { return $screen; } } else { - $screen = new WP_Screen(); + $screen = new self(); $screen->id = $id; }