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

Global Header misplaced with Gutenberg 12.9 #193

Closed
ocean90 opened this issue Mar 30, 2022 · 5 comments
Closed

Global Header misplaced with Gutenberg 12.9 #193

ocean90 opened this issue Mar 30, 2022 · 5 comments

Comments

@ocean90
Copy link
Member

ocean90 commented Mar 30, 2022

Gutenberg 12.9 has been released. After a svn up on my sandbox I got a broken header. Reverting to 12.8.1 restores the current header. I'm going to pin the plugin external to 12.8.1 for now. (Done in r18671.)

image

@iandunn
Copy link
Member

iandunn commented Mar 30, 2022

Thanks for catching that and pinning!

@ryelle
Copy link
Contributor

ryelle commented Mar 30, 2022

Seems like the issue is that the header group is now wrapped in an inner-container block, possibly as a result of this change: WordPress/gutenberg#39321 — but whether it will be wrapped depends on whether the theme has a theme.json, so we'll need to handle both cases.

@ocean90
Copy link
Member Author

ocean90 commented Mar 30, 2022

Looks like the new block specific filter needs to be added to

/**
* Remove the wrapping element to preserve markup.
*
* Core and Gutenberg add a wrapper `div` for backwards-compatibility, but that is unnecessary here, and breaks
* CSS selectors.
*
* @see restore_inner_group_container()
*/
function remove_inner_group_container() {
if ( wp_is_block_theme() ) {
return;
}
remove_filter( 'render_block', 'wp_restore_group_inner_container' );
remove_filter( 'render_block', 'gutenberg_restore_group_inner_container' );
}
/**
* Restore the wrapping element to prevent side-effects on the content area.
*
* @see remove_inner_group_container()
*/
function restore_inner_group_container() {
if ( wp_is_block_theme() ) {
return;
}
if ( function_exists( 'gutenberg_restore_group_inner_container' ) ) {
add_filter( 'render_block', 'gutenberg_restore_group_inner_container', 10, 2 );
} else {
add_filter( 'render_block', 'wp_restore_group_inner_container', 10, 2 );
}
}
.

@iandunn
Copy link
Member

iandunn commented Mar 30, 2022

Pinned buddypress.org in r18672-dotorg

@ocean90
Copy link
Member Author

ocean90 commented Apr 7, 2022

Fixed in #200.

@ocean90 ocean90 closed this as completed Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants