Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataViews: remove filter.name #55834

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/edit-site/src/components/dataviews/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ const field = [

A filter is an object that may contain the following properties:

- `name`: nice looking name for the filter. Field filters may omit it, in which case the field's `header` will be used.
- `type`: the type of filter. Only `enumeration` is supported at the moment.
- `elements`: for filters of type `enumeration`, the list of options to show. A one-dimensional array of object with value/label keys, as in `[ { value: 1, label: "Value name" } ]`.
- `value`: what's serialized into the view's filters.
Expand All @@ -193,9 +192,7 @@ const field = [
filters: [
'enumeration',
{ type: 'enumeration' },
{ type: 'enumeration' },
{ type: 'enumeration', name: __( 'Author' ) },
{ type: 'enumeration', name: __( 'Author' ), elements: authors },
{ type: 'enumeration', elements: authors },
],
}
];
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/dataviews/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Filters( { fields, view, onChangeView } ) {
if ( 'object' === typeof filter ) {
filterIndex[ id ] = {
id,
name: filter.name || field.header,
name: field.header,
type: filter.type,
};
}
Expand Down
Loading