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

WP_HTML_Processor for replacing content inside tag #59623

Open
wpsoul opened this issue Mar 6, 2024 · 2 comments
Open

WP_HTML_Processor for replacing content inside tag #59623

wpsoul opened this issue Mar 6, 2024 · 2 comments
Labels
[Feature] HTML API An API for updating HTML attributes in markup [Type] Enhancement A suggestion for improvement.

Comments

@wpsoul
Copy link

wpsoul commented Mar 6, 2024

I tried to find any example, but can't get it.

I would like to replace content in specific tag. I found only methods to replace attribute on tag but not content. Is it possible?

@wpsoul wpsoul added the [Type] Enhancement A suggestion for improvement. label Mar 6, 2024
@stokesman
Copy link
Contributor

Not yet, but that is apparently part of the plan. From: https://make.wordpress.org/core/2023/10/21/updates-to-the-html-api-in-6-4/

In the future, it will be possible to insert and remove entire tags and to read and modify the inner markup inside a tag. In WordPress 6.4, however, the only new feature is the concept of breadcrumbs.

@gziolo gziolo added the [Feature] HTML API An API for updating HTML attributes in markup label Mar 8, 2024
@gziolo
Copy link
Member

gziolo commented Mar 26, 2024

It’s on the HTML API roadmap and planned for WordPress 6.6:

Add functionality to the HTML API
set_inner_html()

See more in #57827.

@dmsnell, it would be helpful to provide more details in this issue and link back on the discussion with initial plans for WP 6.6.

Edit (from @dmsnell): Fixed the link to the discussion about the HTML API plans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] HTML API An API for updating HTML attributes in markup [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants