WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.32k stars 4.12k forks source link

Block Bindings API/UI: Don't show post meta fields that start with an underscore _ #64575

Closed bacoords closed 3 weeks ago

bacoords commented 3 weeks ago

What problem does this address?

It's a precedent that post meta fields starting with an underscore are "hidden" and don't show up in the regular Custom Fields UI. Feels like they shouldn't show up in the new Block Bindings UI either:

https://developer.wordpress.org/reference/functions/add_post_meta/#comment-467

Screenshot 2024-08-16 at 8 08 58 AM

What is your proposed solution?

Only show post meta fields that don't start with an underscore.

Related Conversation: https://github.com/WordPress/gutenberg/pull/64570#issuecomment-2293662672

justintadlock commented 3 weeks ago

It would be correct to hide post meta with keys that begin with an underscore. These are considered "private" meta keys and should never appear in admin UIs: https://developer.wordpress.org/plugins/metadata/managing-post-metadata/#hidden-custom-fields

cbravobernal commented 3 weeks ago

I'll take this one.

cbravobernal commented 3 weeks ago

It is solved with a temporary fix, but we should move that logic to the server as mentioned here: https://github.com/WordPress/gutenberg/pull/64618#pullrequestreview-2250827221