Title: WP_View_Config_Data::list_item_identity
Published: August 20, 2026

---

# WP_View_Config_Data::list_item_identity( mixed $item ): string|null

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Resolves the identity used to match a list member against another.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#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](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#parameters)󠁿

 `$item`mixedrequired

The list member.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#return)󠁿

 string|null The identity, or null when the member has none.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#source)󠁿

    ```php
    private function list_item_identity( $item ) {
    	if ( is_scalar( $item ) ) {
    		return (string) $item;
    	}

    	if ( is_array( $item ) && ! array_is_list( $item ) ) {
    		foreach ( array( 'id', 'slug', 'field' ) as $key ) {
    			if ( isset( $item[ $key ] ) && is_scalar( $item[ $key ] ) ) {
    				return (string) $item[ $key ];
    			}
    		}
    	}

    	return null;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-view-config-data.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-view-config-data.php#L732)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-view-config-data.php#L732-L746)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_View_Config_Data::remove_properties()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_properties/)`wp-includes/class-wp-view-config-data.php` |

Removes the properties a spec names from the current value.

  | 
| [WP_View_Config_Data::remove_list_member()](https://developer.wordpress.org/reference/classes/wp_view_config_data/remove_list_member/)`wp-includes/class-wp-view-config-data.php` |

Removes the first list member matching an identity, leaving the rest.

  | 
| [WP_View_Config_Data::merge_list_by_identity()](https://developer.wordpress.org/reference/classes/wp_view_config_data/merge_list_by_identity/)`wp-includes/class-wp-view-config-data.php` |

Merges an incoming list into the current one by member identity.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_view_config_data/list_item_identity/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_view_config_data%2Flist_item_identity%2F)
before being able to contribute a note or feedback.