[wp-trac] [WordPress Trac] #23537: Require attributes, not classes
WordPress Trac
noreply at wordpress.org
Tue Feb 19 18:20:03 UTC 2013
#23537: Require attributes, not classes
-----------------------------+-----------------------------
Reporter: ryanve | Type: feature request
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Template
Version: | Severity: normal
Keywords: |
-----------------------------+-----------------------------
Currently
themes[http://codex.wordpress.org/Theme_Review#Template_Tags_and_Hooks
must] use
[http://codex.wordpress.org/Function_Reference/language_attributes
language_attributes],
[http://codex.wordpress.org/Function_Reference/body_class body_class],
[http://codex.wordpress.org/Function_Reference/post_class post_class]
[http://codex.wordpress.org/Function_Reference/comment_class
comment_class]. Rather then requiring direct usage of those, it'd be far
more useful to have (and instead require) functions for the entire
attributes output, with corresponding filter hooks. The current `_class`
functions/hooks would still run, albeit internally via these new
functions. This approach is scalable to future attribute needs.
{{{
<html <?php html_attrs(); ?>>
<body <?php body_attrs(); ?>>
<article <?php post_attrs(); ?>>
<li <?php comment_attrs(); ?>>
}}}
There also should be `get_` versions. Using the `get_` version in the
theme (or manually applying the hook) should suffice to meet requirements.
The hooks are the underlying reason for requiring these functions. Hooks
would run in the `get_` versions. #23236 can ensure safe output and DRY
code.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23537>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list