Prerequisites
Please give us a description of what happened
There's an issue with the Force_Rewrite_Title class. Gutenberg seems to add inline styles after wp_footer hook, e.g. global-inline-styles-css. In Force_Rewrite_Title class everything between template_redirect hook and wp_footer is considered for ouput, which fails for content included after wp_footer, e.g. gutenberg inline styles.
Possible solution:
replace
\add_action( 'wp_footer', [ $this, 'flush_cache' ], -1 );
with
\add_action( 'shutdown', [ $this, 'flush_cache' ], -1 );
in
register_hooks()
While almost all modern themes have theme_support('title-tag') enabled, this does not need to be with custom themes and might lead to some strange behaviour.
Step-by-step reproduction instructions
- Create custom theme without
add_theme_support('title-tag')
- Enable yoast setting "force rewrite title"
- Create a page with a
core/columns block with two or more columns
- In frontend columns styles are not as supposed
Expected results
- yoast should not skip gutenberg's inline styles while replacing title tag
Actual results
- yoast "removes" gutenberg's inline styles
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
All
Operating system
All
PHP version
All
WordPress version
e.g. 6.9.4
WordPress Theme
Any theme without add_theme_support('title-tag')
Yoast SEO version
e.g. 27.3
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
Yoast SEO
Prerequisites
Please give us a description of what happened
There's an issue with the Force_Rewrite_Title class. Gutenberg seems to add inline styles after wp_footer hook, e.g. global-inline-styles-css. In Force_Rewrite_Title class everything between
template_redirecthook andwp_footeris considered for ouput, which fails for content included after wp_footer, e.g. gutenberg inline styles.Possible solution:
replace
\add_action( 'wp_footer', [ $this, 'flush_cache' ], -1 );with
\add_action( 'shutdown', [ $this, 'flush_cache' ], -1 );in
register_hooks()
While almost all modern themes have theme_support('title-tag') enabled, this does not need to be with custom themes and might lead to some strange behaviour.
Step-by-step reproduction instructions
add_theme_support('title-tag')core/columnsblock with two or more columnsExpected results
Actual results
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
All
Operating system
All
PHP version
All
WordPress version
e.g. 6.9.4
WordPress Theme
Any theme without add_theme_support('title-tag')
Yoast SEO version
e.g. 27.3
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
Yoast SEO