Changeset 65335
- Timestamp:
- 11/07/2026 11:18:43 PM (8 hours ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/functions.php
r65314 r65335 82 82 * @param int $priority Unused. The order in which the functions 83 83 * associated with a particular action are executed. 84 * @return string Unique function ID for usage as array key.84 * @return string|null Unique function ID for usage as array key, or null if it couldn't be determined. 85 85 */ 86 86 function _test_filter_build_unique_id( $hook_name, $callback, $priority ) { … … 90 90 91 91 if ( is_object( $callback ) ) { 92 // Closures are currently implemented as objects. 92 /* 93 * The prefix keeps the ID from being the decimal representation of an integer. PHP casts such a 94 * string to int when it is used as an array key, which would change the type of the keys in 95 * WP_Hook::$callbacks and break consumers that pass them to string functions. 96 */ 93 97 return 'spl_object_id:' . spl_object_id( $callback ); 94 98 } 95 99 96 $callback = (array) $callback; 100 if ( ! isset( $callback[1] ) || ! is_string( $callback[1] ) ) { 101 return null; 102 } 97 103 98 104 if ( is_object( $callback[0] ) ) { … … 103 109 return $callback[0] . '::' . $callback[1]; 104 110 } 111 112 return null; 105 113 } 106 114
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)