Make WordPress Core

Changeset 56542


Ignore:
Timestamp:
09/07/2023 08:39:07 PM (3 years ago)
Author:
hellofromTonya
Message:

Code Modernization: Use wp_trigger_error() in WP_List_Table magic methods.

Replaces trigger_error() with wp_trigger_error() in each of the WP_List_Table magic methods.

[56349] added the dynamic properties deprecation messages to the __get(), __set(), __isset(), __unset() magic methods. Since that commit, wp_trigger_error() was introduced (see [56530]) as a wrapper for trigger_error().

Follow-up to [56349], [56356], [56530].

See #58896, #57686.

Location:
trunk
Files:
2 edited

Legend:

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

    r56450 r56542  
    187187                }
    188188
    189                 trigger_error(
     189                wp_trigger_error(
     190                        __METHOD__,
    190191                        "The property `{$name}` is not declared. Getting a dynamic property is " .
    191192                        'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    210211                }
    211212
    212                 trigger_error(
     213                wp_trigger_error(
     214                        __METHOD__,
    213215                        "The property `{$name}` is not declared. Setting a dynamic property is " .
    214216                        'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    231233                }
    232234
    233                 trigger_error(
     235                wp_trigger_error(
     236                        __METHOD__,
    234237                        "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
    235238                        'is deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    253256                }
    254257
    255                 trigger_error(
     258                wp_trigger_error(
     259                        __METHOD__,
    256260                        "A property `{$name}` is not declared. Unsetting a dynamic property is " .
    257261                        'deprecated since version 6.4.0! Instead, declare the property on the class.',
  • trunk/tests/phpunit/tests/admin/wpListTable.php

    r56356 r56542  
    390390                $this->expectDeprecation();
    391391                $this->expectDeprecationMessage(
     392                        'WP_List_Table::__get(): ' .
    392393                        'The property `undeclared_property` is not declared. Getting a dynamic property is ' .
    393394                        'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    419420                $this->expectDeprecation();
    420421                $this->expectDeprecationMessage(
     422                        'WP_List_Table::__set(): ' .
    421423                        'The property `undeclared_property` is not declared. Setting a dynamic property is ' .
    422424                        'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    451453                $this->expectDeprecation();
    452454                $this->expectDeprecationMessage(
     455                        'WP_List_Table::__isset(): ' .
    453456                        'The property `undeclared_property` is not declared. Checking `isset()` on a dynamic property ' .
    454457                        'is deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    478481                $this->expectDeprecation();
    479482                $this->expectDeprecationMessage(
     483                        'WP_List_Table::__unset(): ' .
    480484                        'A property `undeclared_property` is not declared. Unsetting a dynamic property is ' .
    481485                        'deprecated since version 6.4.0! Instead, declare the property on the class.'
Note: See TracChangeset for help on using the changeset viewer.