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

Footnotes: Trim footnote anchors from excerpts backport from Gutenberg #4845

Closed

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jul 14, 2023

Backports changes from WordPress/gutenberg#52518

Adding a function to wp_trim_excerpt that removes footnotes from content.
Adds tests

Trac ticket: https://core.trac.wordpress.org/ticket/58805


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ramonjd
Copy link
Member Author

ramonjd commented Jul 14, 2023

cc @mcsf

Not sure if this is what you had in mind. Feel free to trash this one if so 😄

Also not sure if where I've put things is correct, e.g., different file? Different place in the excerpt formatting chain 🤷🏻

I probably need more tests too. Testing this PR surface a couple of bugs, e.g., WordPress/gutenberg#52628

src/wp-includes/blocks.php Outdated Show resolved Hide resolved
Prefer PHP 8's str_contains
@mcsf
Copy link

mcsf commented Jul 14, 2023

Not sure if this is what you had in mind. Feel free to trash this one if so 😄

I've responded in Trac already, but yeah, this is great! :)

Copy link
Contributor

@costdev costdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @ramonjd! LGTM 👍

@tellthemachines
Copy link
Contributor

Committed in r56244 / 2beefda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

5 participants