-
Notifications
You must be signed in to change notification settings - Fork 0
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
Wordpress 6.3 removes html tags from custom excerpt #1
Comments
OK, so it looks like WordPress/Documentation-Issue-Tracker#687 changes were merged into 6.3 to introduce excerpt length controls within UI. The pull request WordPress/gutenberg#44964 adds logic to packages/block-library/src/post-excerpt/index.php to check if an excerpt_length exists... if it does, then it calls "wp_trim_words()" which strips all HTML tags
Looks like we'll need to over-ride wp_trim_words...? |
There doesn't seem to be anyway to override the HTML stripping taking place with the query loop excerpt block |
Yep, I agree, which is why I also made a comment on the Gutenberg report to that effect. I haven't found a sensible workaround, so I believe the right thing is for it to be fixed in the main repo |
Hi! Coming from a different issue I faced with WordPress's new way of handling excerpts. I found that the "block_type_metadata" filter gives me ability to override original Gutenberg block settings and this way I can modify the original "excerptLength" config of the excerpt block:
Although this does not help you with your problem directly, it is possible to completely remove the "excerptLength" key from the metadata attributes array, and hopefully this will help you too by using simply get_the_excerpt() again and not trimming it with wp_trim_words:
|
@frzsombor that fixed my specific issue as well, thank you! |
Fixed with solution from @frzsombor |
Upgrade from 6.2 to 6.3 removes the html tags in the output of code the replaces the excerpt
The text was updated successfully, but these errors were encountered: