wp-includes/class-wp-view-config-data.php:515Merges an incoming value into the current one, recursing by value shape.
$currentmixed$incomingmixed$replace_listsboolmixed private function merge_properties( $current, $incoming, $replace_lists ) { // Scalar properties are merged as-is. if ( ! is_array( $incoming ) ) { return $incoming; } // Numerical indexed arrays are expected to be lists (sequential integer keys starting at 0). if ( array_is_list( $incoming ) ) { // A non-empty list only lands where a list (or nothing) lives, under // merge() and replace() alike. An empty array is shape-ambiguous and // exempt, so replace() with an empty list can still clear a list. if ( array() !== $incoming && is_array( $current ) && ! array_is_list( $current ) && array() !== $current ) { _doing_it_wrong( __METHOD__, esc_html__( 'A view configuration patch value must match the shape of the value it patches: a list merges into a list, and an associative array into an associative array.' ), '7.1.0' ); return $current; } // replace() takes an incoming list as-is; merge() merges it by member identity. if ( $replace_lists ) { // As-is except for nulls: a list swapped in wholesale has no // existing leaf for a null to delete (the same rationale as // set()), so a null member is dropped rather than stored. return $this->strip_nulls( $incoming ); } // An empty list has no members to merge, and an empty array is // shape-ambiguous, so merging one is a no-op rather than a reset. if ( array() === $incoming ) { return $current; } return $this->merge_list_by_identity( is_array( $current ) && array_is_list( $current ) ? $current : array(), $incoming ); } // Consider any other array as associative (keys are strings). if ( is_array( $current ) && array_is_list( $current ) && array() !== $current ) { _doing_it_wrong( __METHOD__, esc_html__( 'A view configuration patch value must match the shape of the value it patches: a list merges into a list, and an associative array into an associative array.' ), '7.1.0' ); return $current; } $result = is_array( $current ) && ! array_is_list( $current ) ? $current : array(); foreach ( $incoming as $key => $value ) { // A null patch value deletes the property. if ( null === $value ) { unset( $result[ $key ] ); continue; } $result[ $key ] = $this->merge_properties( array_key_exists( $key, $result ) ? $result[ $key ] : array(), $value, $replace_lists ); } return $result; }Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
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.