-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the collect of meta box data. Fixed a bug where meta boxes…
… may not be shown if they were moved to other location by the user. We were checking the locations where we have meta boxes in gutenberg_collect_meta_box_data. But our logic did not take into account that the locations of the meta boxes may be changed by the user. So if the user moved meta boxes that by default appeared in the normal location to the sidebar and had no default sidebar meta box, sidebar meta boxes would not be visible. To solve that we would need to copy the mechanism that reads user preferences for meta boxes to check their location from do_meta_boxes. Copying this logic makes gutenberg_collect_meta_box_data more complex and increases the maintainability efforts. It would also be very inefficient as that code would be executed multiple times. So the computing of the array of locations where we have meta boxes was moved to the_gutenberg_metaboxes function where we invoke do_meta_boxes function. This way we can take advantage of the fact that do_meta_boxes returns the number of meta boxes that were outputted.
- Loading branch information
1 parent
e9c1c20
commit 1e081b4
Showing
3 changed files
with
43 additions
and
125 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