You appear to be a bot. Output may be restricted
Description
Generates a unique function ID based on the given arguments.
Usage
$string = _test_filter_build_unique_id( $tag, $function, $priority );
Parameters
- $tag
- ( string ) required – Unused. The name of the filter to build ID for.
- $function
- ( callable ) required – The function to generate ID for.
- $priority
- ( int ) required – Unused. The order in which the functions associated with a particular action are executed.
Returns
string Unique function ID for usage as array key.
Source
File name: wordpress-develop-tests/phpunit/includes/functions.php
Lines:
1 to 21 of 21
function _test_filter_build_unique_id( $tag, $function, $priority ) { if ( is_string( $function ) ) { return $function; } if ( is_object( $function ) ) { // Closures are currently implemented as objects. $function = array( $function, '' ); } else { $function = (array) $function; } if ( is_object( $function[0] ) ) { // Object class calling. return spl_object_hash( $function[0] ) . $function[1]; } elseif ( is_string( $function[0] ) ) { // Static calling. return $function[0] . '::' . $function[1]; } }