Replaces list values while merging the rest of a partial configuration.
Description
Takes the same arguments as merge() and applies the patch the same way, with one difference: a list in the patch replaces the current list wholesale instead of merging into it by member identity. Associative arrays still merge key by key, null still drops what it names, and a scalar still replaces the current value. It shouldn't be the default choice — a callback that replaces a list stops inheriting core's future additions to it — but it's useful when a contributor needs to pin a list to an exact set of members. The shape rule applies here too: a patch value whose shape does not match the current value — an associative array where a list lives, or a non-empty list where an associative value lives — is rejected with a notice and leaves the current value unchanged. An empty array is exempt, so replacing a list with an empty list still clears it. A patch that declares an unsupported schema version is rejected and does not change anything.
Parameters
$patcharray
The partial configuration to apply.
$versionint
The schema version the patch was authored against.
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.