Make WordPress Core

Changeset 56543


Ignore:
Timestamp:
09/07/2023 08:43:48 PM (17 months ago)
Author:
hellofromTonya
Message:

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

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

[56353] 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 [56353], [56530].

See #58897, #57686.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user-query.php

    r56381 r56543  
    11231123        }
    11241124
    1125         trigger_error(
     1125        wp_trigger_error(
     1126            __METHOD__,
    11261127            "The property `{$name}` is not declared. Getting a dynamic property is " .
    11271128            'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    11461147        }
    11471148
    1148         trigger_error(
     1149        wp_trigger_error(
     1150            __METHOD__,
    11491151            "The property `{$name}` is not declared. Setting a dynamic property is " .
    11501152            'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    11671169        }
    11681170
    1169         trigger_error(
     1171        wp_trigger_error(
     1172            __METHOD__,
    11701173            "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
    11711174            'is deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    11891192        }
    11901193
    1191         trigger_error(
     1194        wp_trigger_error(
     1195            __METHOD__,
    11921196            "A property `{$name}` is not declared. Unsetting a dynamic property is " .
    11931197            'deprecated since version 6.4.0! Instead, declare the property on the class.',
  • trunk/tests/phpunit/tests/user/query.php

    r56353 r56543  
    22542254        $this->expectDeprecation();
    22552255        $this->expectDeprecationMessage(
     2256            'WP_User_Query::__get(): ' .
    22562257            'The property `undefined_property` is not declared. Getting a dynamic property is ' .
    22572258            'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    22862287        $this->expectDeprecation();
    22872288        $this->expectDeprecationMessage(
     2289            'WP_User_Query::__set(): ' .
    22882290            'The property `undefined_property` is not declared. Setting a dynamic property is ' .
    22892291            'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    23222324        $this->expectDeprecation();
    23232325        $this->expectDeprecationMessage(
     2326            'WP_User_Query::__isset(): ' .
    23242327            'The property `undefined_property` is not declared. Checking `isset()` on a dynamic property ' .
    23252328            'is deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    23532356        $this->expectDeprecation();
    23542357        $this->expectDeprecationMessage(
     2358            'WP_User_Query::__unset(): ' .
    23552359            'A property `undefined_property` is not declared. Unsetting a dynamic property is ' .
    23562360            'deprecated since version 6.4.0! Instead, declare the property on the class.'
Note: See TracChangeset for help on using the changeset viewer.