[wp-trac] [WordPress Trac] #60229: HTML API: Introduce HTML Templating
WordPress Trac
noreply at wordpress.org
Mon Feb 26 20:03:30 UTC 2024
#60229: HTML API: Introduce HTML Templating
-------------------------------------------------+-------------------------
Reporter: dmsnell | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: HTML API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs-dev- | Focuses:
note dev-feedback |
-------------------------------------------------+-------------------------
Comment (by dmsnell):
@peterwilsoncc I'll definitely be posting on Make soon; the PR is here so
that there's actual work to examine and discuss, but I've been
simultaneously distracted by and considerate of the schedule for 6.5 to
wait to invite the broader discussion on HTML generation.
> WordPress themes have moved away from PHP templates in favor of HTML
files and JSON data. As more features are added to the site editor, the
current need for PHP in some instances will be reduced further with
dynamic blocks. A templating API will leave future core contributors
having to maintain both the new and the old methods of escaping.
While I hear what you are saying about the use of PHP in WordPress themes,
I've also observed that we've driven towards //more// PHP to support
various blocks, whereby many developers are actively thinking about and
producing PHP that produces HTML than before.
The goal of this templating work is to provide a system of convenient HTML
creation that's easier by default than the current array of methods, which
are any old mixture of PHP and HTML, and frequently forgetting to call
escaping. The primary idea is to remove the need for everyone to have to
remember to manually perform all of the steps and do so in the right way,
choosing the right escaping in the right times, in order to ensure that
WordPress presents a safe experience.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60229#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list