WordPress build repository browser

Changeset 64454


Ignore:
Timestamp:
11/06/2026 06:11:55 PM (3 days ago)
Author:
desrosj
Message:

Build/Test Tools: Use spl_object_id() in _test_filter_build_unique_id().

spl_object_hash() has been deprecated in PHP 8.6. tests_add_filter() uses this helper to build callback IDs before WordPress is loaded. A deprecation notice is triggered for plugin and theme test suites that register a closure or an object method during bootstrap.

The helper now builds the same IDs as _wp_filter_build_unique_id(), which switched to spl_object_id() in r62408 and began prefixing object IDs in r63334. The callbacks that run do not change because WP_Hook::build_preinitialized_hooks() re-adds every pre-loaded callback with add_filter().

A new test is included to confirm that both functions return the same ID for each type of callback.

Follow-up to r62408, r63334.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/15625.

Props dhrupo.
Fixes #66512.

Built from ​https://develop.svn.wordpress.org/trunk@65314

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.