Post Excerpts Block: Fix "read more" theme override#71179
Post Excerpts Block: Fix "read more" theme override#71179scruffian merged 2 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| ) | ||
| ); | ||
|
|
||
| $post_id = wp_insert_post( |
There was a problem hiding this comment.
I didn't use the factory for the post because the post excerpt needs to be generated automatically. The factory method on the post has a default stubbed value for the excerpt.
scruffian
left a comment
There was a problem hiding this comment.
I've tested this and it works as advertised. The code change looks good too. 🚢
What?
When a classic theme has a custom filter for
except_moreand the site is using query block in a page configured with a read more text, the site displays both "Read more" links.Gutenberg should hide the read more text set by the theme to avoid having duplicate "Read more" strings.
Why?
This PR fixes this issue by removing the theme filter and using only the Gutenberg
read moreconfig.How?
We simply need to move where we apply the filter. It needs to be before the excerpt is retrieved from the DB.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast