-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Rename wp_send_late_headers action to wp_finalized_template_enhancement_output_buffer
#10443
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
Conversation
…nside action/filter callbacks
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
dmsnell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any strong feelings about the names, including the previous one, after stands out more clearly to me than finalized, and I think we can see some natural associations with it based on the way the documentation for the filter is worded.
There is nothing in here that jumps out as issues for concern.
| * | ||
| * Important: Because this filter is applied inside an output buffer callback (i.e. display handler), any callbacks | ||
| * added to the filter must not attempt to start their own output buffers. Otherwise, PHP will raise a fatal error: | ||
| * "Cannot use output buffering in output buffering display handlers." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be a comment for a discussion outside of this change, but does this stipulation apply to PHP code running inside the template generation too? I know various bits of code that use output buffering for small things, including block themes loading templates via include. If it’s a new default behavior that those snippets will now crash, we should make sure to communicate that in a Dev Note prominently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it doesn't apply to PHP code running inside the template generation. Otherwise, this would have been totally infeasible.
Nested output buffers are normal. It's just not allowed to open output buffers inside the callback for handling an output buffer.
@dmsnell Do you mean There's Update: Clarified in Slack. |
…te_enhancement_output_buffer`. Also update docs for `wp_finalized_template_enhancement_output_buffer` action and `wp_template_enhancement_output_buffer` filter to warn against attempting to open an output buffer in callbacks or else a PHP fatal error will occur. Developed in #10443 Follow-up to [61088], [60936]. Props westonruter, dmsnell. See #43258. Fixes #64126. git-svn-id: https://develop.svn.wordpress.org/trunk@61111 602fd350-edb4-49c9-b593-d223f7449a82
|
Committed in r61111. |
…te_enhancement_output_buffer`. Also update docs for `wp_finalized_template_enhancement_output_buffer` action and `wp_template_enhancement_output_buffer` filter to warn against attempting to open an output buffer in callbacks or else a PHP fatal error will occur. Developed in WordPress/wordpress-develop#10443 Follow-up to [61088], [60936]. Props westonruter, dmsnell. See #43258. Fixes #64126. Built from https://develop.svn.wordpress.org/trunk@61111 git-svn-id: http://core.svn.wordpress.org/trunk@60447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…te_enhancement_output_buffer`. Also update docs for `wp_finalized_template_enhancement_output_buffer` action and `wp_template_enhancement_output_buffer` filter to warn against attempting to open an output buffer in callbacks or else a PHP fatal error will occur. Developed in WordPress/wordpress-develop#10443 Follow-up to [61088], [60936]. Props westonruter, dmsnell. See #43258. Fixes #64126. Built from https://develop.svn.wordpress.org/trunk@61111 git-svn-id: https://core.svn.wordpress.org/trunk@60447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow up to #10381 (r61088 / b482707).
See #10381 (comment)
Trac ticket: https://core.trac.wordpress.org/ticket/64126
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.