forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Post fields: move
comment_status
from edit-site
to fields
packa…
…ge (WordPress#66934) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
- Loading branch information
1 parent
5625cf1
commit 2844f0e
Showing
4 changed files
with
47 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import type { Field } from '@wordpress/dataviews'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import type { BasePost } from '../../types'; | ||
|
||
const commentStatusField: Field< BasePost > = { | ||
id: 'comment_status', | ||
label: __( 'Discussion' ), | ||
type: 'text', | ||
Edit: 'radio', | ||
enableSorting: false, | ||
filterBy: { | ||
operators: [], | ||
}, | ||
elements: [ | ||
{ | ||
value: 'open', | ||
label: __( 'Open' ), | ||
description: __( 'Visitors can add new comments and replies.' ), | ||
}, | ||
{ | ||
value: 'closed', | ||
label: __( 'Closed' ), | ||
description: __( | ||
'Visitors cannot add new comments or replies. Existing comments remain visible.' | ||
), | ||
}, | ||
], | ||
}; | ||
|
||
/** | ||
* Comment status field for BasePost. | ||
*/ | ||
export default commentStatusField; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters