Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored meta box data collection. Fixed a bug where meta boxes may not be shown. #5619

Merged

Commits on Mar 19, 2018

  1. 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.
    jorgefilipecosta committed Mar 19, 2018
    Configuration menu
    Copy the full SHA
    1a2dc81 View commit details
    Browse the repository at this point in the history