Skip to content

Fix missing return value in force_filtered_html_on_import footnotes filter - #81293

Merged
aduth merged 2 commits into
trunkfrom
fix/missing-return-value-footnotes-filter
Aug 6, 2026
Merged

Fix missing return value in force_filtered_html_on_import footnotes filter#81293
aduth merged 2 commits into
trunkfrom
fix/missing-return-value-footnotes-filter

Conversation

@aduth

@aduth aduth commented Aug 6, 2026

Copy link
Copy Markdown
Member

What?

This PR adds back a missing return value of the force_filtered_html_on_import filter in the _gutenberg_footnotes_force_filtered_html_on_import_filter callback. Previously it did not return a value on one of its branches.

Why?

A filter callback must always return the value it receives. In our function, when the core function _wp_filter_post_meta_footnotes() exists, the code did return;. This returns null instead of the original value.

How?

The fix is very small. On the short-circuit branch we now return the input value instead of nothing:

if ( function_exists( '_wp_filter_post_meta_footnotes' ) ) {
	return $arg; // Before: return;
}

Testing Instructions

Verify PHP tests pass.

Use of AI Tools

Changes applied manually.

@aduth
aduth requested a review from spacedmonkey as a code owner August 6, 2026 15:27
@aduth aduth added [Type] Bug An existing feature does not function as intended Backport to Gutenberg Minor Release Pull request that needs to be backported to a Gutenberg minor release labels Aug 6, 2026
@aduth aduth added this to the Gutenberg 23.7 milestone Aug 6, 2026
@aduth
aduth requested a review from tyxla August 6, 2026 15:30
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: aaronjorbin <jorbin@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@aduth
aduth force-pushed the fix/missing-return-value-footnotes-filter branch from a109d7f to b55c798 Compare August 6, 2026 17:54
@aduth
aduth merged commit b7e98ae into trunk Aug 6, 2026
43 of 44 checks passed
@aduth
aduth deleted the fix/missing-return-value-footnotes-filter branch August 6, 2026 23:57
@aduth

aduth commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

I just cherry-picked this PR to the release/23.7 branch to get it included in the next release: f54adf3

aduth added a commit that referenced this pull request Aug 6, 2026
…ilter (#81293)

* Fix missing return value in force_filtered_html_on_import footnotes filter

Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: aaronjorbin <jorbin@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
@aduth aduth removed the Backport to Gutenberg Minor Release Pull request that needs to be backported to a Gutenberg minor release label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants