Resolves the identity used to match a list member against another.
Description
The identity is simply the member's value cast to a string, regardless of which key carries it: a bare scalar is its own identity, and a map is identified by the value of the first of the well-known identity keys (id, slug, field) it carries. Because the key is not part of the identity, a bare field like 'f3' matches any map carrying that value, whether it appears as array( 'id' => 'f3' ), array( 'slug' => 'f3' ), and so on — this lets the same shorthand target lists keyed by different fields. Casting to string keeps numeric identities matching whether they arrive as an int or a string. Anything else (e.g. a nested list) has no identity and never matches, so it is always appended.
Parameters
$itemmixed
The list member.
Return
string|null
The identity, or null when the member has none.
Uses · 1
array_is_list()Polyfill for `array_is_list()` function added in PHP 8.1.
Signature, return type and hooks compared across 1 parsed release.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-view-config-data.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.