Make WordPress Core

Changeset 53039


Ignore:
Timestamp:
03/31/2022 03:19:10 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-list-table.php.

While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the $default parameter to $default_value in WP_List_Table::get_items_per_page().

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

File:
1 edited

Legend:

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

    r51880 r53039  
    825825     *
    826826     * @param string $option
    827      * @param int    $default
     827     * @param int    $default_value
    828828     * @return int
    829829     */
    830     protected function get_items_per_page( $option, $default = 20 ) {
     830    protected function get_items_per_page( $option, $default_value = 20 ) {
    831831        $per_page = (int) get_user_option( $option );
    832832        if ( empty( $per_page ) || $per_page < 1 ) {
    833             $per_page = $default;
     833            $per_page = $default_value;
    834834        }
    835835
Note: See TracChangeset for help on using the changeset viewer.