[wp-trac] [WordPress Trac] #28180: No get equivalent for language_attributes()
WordPress Trac
noreply at wordpress.org
Thu May 8 21:28:25 UTC 2014
#28180: No get equivalent for language_attributes()
--------------------------+-----------------------------
Reporter: PeterRKnight | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 3.9
Severity: normal | Keywords:
Focuses: template |
--------------------------+-----------------------------
In core most functions that can output a string call a function that
returns a string instead of returning it. The language_attributes()
function is an exception to this and always echoes a string. I was
expecting there to be an equivalent get_language_attributes() function
that returns a string instead.
I ran into this need while coding conditional IE fallback code for the
opening HTML tag. Rather than call language_attributes() multiple times, I
wanted to store the attributes in a string. The current workaround is
either using output buffering or simply calling language_attributes()
multiple times, both of which are undesirable because it adds unnecessary
operations. It also imposes a limitation in how a developer may choose to
output html.
I propose adding get_language_attributes() for consistency and flexibility
purposes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28180>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list