Filters the view configuration for a given entity.
Description
The dynamic portions of the hook name, $kind and $name, refer to the entity kind (e.g. postType) and the entity name (e.g. page), lowercased — so the postType/page entity maps to the get_entity_view_config_posttype_page hook. Callbacks receive a WP_View_Config_Data object and change the configuration through its methods. Each write method takes the schema version the change was authored against as its second argument, and returns the object for chaining: <ul> <li>merge( $patch, $version ) merges a partial change into the current configuration. It touches only the top-level keys the patch names, and merges each named value into the current one by shape: a scalar replaces, an associative array merges key by key, and a list merges by member identity (id, slug, or field). A null value drops the key it names, resetting it to its default.</li> <li>replace( $patch, $version ) applies a patch exactly like merge(), but swaps any list it names wholesale instead of merging that list by member identity.</li> <li>set( $patch, $version ) also touches only the keys the patch names, but swaps each named value in wholesale, dropping whatever the key held before — for a callback that owns those keys outright.</li> <li>remove( $spec, $version ) deletes named properties. The spec mirrors the configuration shape: a list of names deletes entries at that level, and a nested map recurses to prune from within a named value, down to individual list members.</li> </ul> A change that declares an unsupported schema version is rejected and does not alter anything. As with any filter, each callback's return value is passed to the next callback as $data, so callbacks must return the container they received: a callback that returns nothing, or any other value, hands that result to every callback hooked at a later priority instead of the container. Since the write methods return the container, a callback can end with return $data->merge( $patch, $version );.
Parameters
$dataWP_View_Config_Data
The view configuration container for the entity, exposing the default_view, default_layouts, view_list, and form keys.
$entityarray
{ The entity the configuration is built for. @type string $kind The entity kind. @type string $name The entity name.}
181* The entity the configuration is built for.182*183* @type string$kind The entity kind.184* @type string$name The entity name.185*}186*/187apply_filters(188wp_get_entity_view_config_hook_name($kind,$name),189$this,190array(191'kind'=>$kind,192'name'=>$name,193)
History
Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, 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.