#45285 closed defect (bug) (wontfix)
Custom Fields do not show up
Reported by: | websupporter | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.0 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
On a clean install, custom fields do not show up when I toggle it in the options. The problem is, the class hide-if-js
is attached to the box, which hides the box. This is because the current implementation does not respect the outcome of get_hidden_meta_boxes()
.
Instead of introducing a new user meta to implement whether to show or to hide the box, I would suggest to rely on get_hidden_meta_boxes()
Attachments (2)
Change History (7)
#3
@
6 years ago
#45282 seems to fix this problem currently as well, at least
$hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden ) ) ? ' hide-if-js' : '';
seems to be another solution to it. This effectively would mean to not take get_hidden_meta_boxes()
into account. So, this function from now on serves only on \WP_Screens which do not serve Gutenberg.
There are two filters:
default_hidden_meta_boxes
hidden_meta_boxes
They would have no longer effect for Gutenberg-Screens.
Thinking about it, this might make sense to deprecate those filters for Gutenberg-Screens.
Given this usage:
<?php add_filter( 'hidden_meta_boxes', function() { return ['postcustom']; } );
What hidden_meta_boxes
did for the old editor was essentially always hide the custom fields box unless the author enabled it again. In this case for this page view, it would be visible again and would be hidden, once he clicks update again. Currently I can't see a really good use case for this and maybe Gutenberg is a good opportunity to say, we say goodbye to this behavior.
#4
@
6 years ago
- Milestone 5.0 deleted
- Resolution set to wontfix
- Status changed from new to closed
Thanks for the bug report and patch, @websupporter!
I'm inclined to agree that this functionality isn't appropriate for the block editor interface: custom fields is kind of a special case, it's the only core meta boxes that we're reusing, everything else has been reimplemented, and doesn't identify as a meta box at all.
Use get_hidden_meta_boxes() information whether to show or hide the box