alleyinteractive / alleyinteractive/meta-inspector

Update dynamically on post types that use the Block Editor

Ouverte
#28 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement gutenberg javascript
Langage dominant
PHP
Étoiles
21
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.