Skip to content

Experiment: template enhancement output buffer#2899

Draft
mardelnet wants to merge 1 commit intomainfrom
experimentation/template-enhancement-output-buffer
Draft

Experiment: template enhancement output buffer#2899
mardelnet wants to merge 1 commit intomainfrom
experimentation/template-enhancement-output-buffer

Conversation

@mardelnet
Copy link
Contributor

@mardelnet mardelnet commented Feb 20, 2026

Summary

This PR experiments with the new template enhancement output buffer introduced with WordPress 6.9.

This output buffer is based on the hook wp_template_enhancement_output_buffer, which can be used to intercept the full HTML output of a template before being delivered to the browser. Among many other possibilities, this hook could help us to move some front functionalities to the server-side, improving their performance.

In this particular experiment, I use the wp_template_enhancement_output_buffer to replace the pdf_icon.js file, in its function of adding an icon to all the links to PDF documents.


Testing

  1. Add a link to a PDF document.
  2. In the front, check that the link has an icon at the end.
  3. Check that the icon is not included in links within headings (H1, H2,...) or links wrapping images.

- Experiment with the template enhancement output buffer
@mardelnet mardelnet self-assigned this Feb 20, 2026
@mardelnet mardelnet added DO NOT MERGE PoC Pull requests that are defined as a proof of concept labels Feb 20, 2026
@mardelnet mardelnet force-pushed the experimentation/template-enhancement-output-buffer branch from cff1a53 to 077b1ba Compare February 20, 2026 11:30
@mardelnet mardelnet changed the title Experiment with a new WordPress feature: the template enhancement output buffer Experiment: template enhancement output buffer Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE PoC Pull requests that are defined as a proof of concept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant