WordPress.org

Make WordPress Core

Changeset 49192


Ignore:
Timestamp:
10/18/2020 05:16:33 PM (11 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r49190 r49192  
    10741074        // fall back to the first non-checkbox column.
    10751075        if ( ! isset( $columns[ $default ] ) ) {
    1076             $default = WP_List_Table::get_default_primary_column_name();
     1076            $default = self::get_default_primary_column_name();
    10771077        }
    10781078
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r49179 r49192  
    378378            }
    379379        } else {
    380             $screen     = new WP_Screen();
     380            $screen     = new self();
    381381            $screen->id = $id;
    382382        }
Note: See TracChangeset for help on using the changeset viewer.