WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 6 months ago

#37461 new enhancement

Introduce get_the_title_attribute() to wrap the_title_attribute( 'echo=0' )

Reported by: sillybean Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Themes Keywords:
Focuses: template Cc:
PR Number:

Description

the_title_attribute( 'echo=0' ) is ugly and annoying given that all the other the_* template tags have corresponding get_* functions.

Patch adds get_title_attribute() as a simple wrapper function.

Attachments (2)

get_title_attribute.diff (807 bytes) - added by sillybean 3 years ago.
get_the_title_attribute.diff (811 bytes) - added by sillybean 3 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
3 years ago

Previously mentioned in comment:28:ticket:24164 (as get_the_title_attribute(), which would follow our naming pattern more closely).

#2 @sillybean
3 years ago

That is an outstanding comment. Updated patch to conform to the pattern.

#3 @SergeyBiryukov
3 years ago

  • Summary changed from Introduce get_title_attribute() to wrap the_title_attribute( 'echo=0' ) to Introduce get_the_title_attribute() to wrap the_title_attribute( 'echo=0' )
Note: See TracTickets for help on using tickets.