Require attributes, not classes
|Reported by:||ryanve||Owned by:|
Currently themesmust use language_attributes, body_class, post_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.
Change History (6)
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Milestone set to Awaiting Review
- Resolution invalid deleted
- Status changed from closed to reopened