alleyinteractive / alleyinteractive/meta-inspector

Update dynamically on post types that use the Block Editor

Đang mở
#28 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement gutenberg javascript
Ngôn ngữ chính
PHP
Star
21
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Description

On post types that use the Block Editor (Gutenberg), it would be useful if the inspector reflected the [Post Editor's data](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-editor/).

### Use Case

Currently in the Block Editor, you must Save the post, then refresh to see the latest meta data.

# Acceptance Criteria

- When displayed in Gutenberg, show using a Gutenberg PluginSidebar instead of a classic metabox.
- Create the PluginSidebar to display all meta.
- Each meta field should be in a collapsible panel so it isn't overwhelming.
- Add a custom REST endpoint to query all post meta, even the meta values that aren't exposed to the Block Editor. This MUST be locked down to only logged in users who have the ability to edit the post for which the data is requested (since they would otherwise be able to see this using the classic editor metabox).
- The sidebar should use [usePostMeta](https://github.com/alleyinteractive/alley-scripts/tree/main/packages/block-editor-tools/src/hooks/use-post-meta) to get a value that has been updated by the Block Editor, and fail back to the value from the REST endpoint. Further, a visual indicator should display whether a value has been modified in the current edit session, indicating what is different between the editor view and what is saved to the server.
- Add a button to view meta values in a modal in addition to the sidebar, so that large meta values can be viewed more easily.
- Add JSON Formatter - if a value is JSON, or expressed as JSON because it's a serialized array/object in PHP, pretty-print the JSON to make it easier to read.

Note to implementer: If desired, split out the AC into smaller tickets.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.