WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 2 years 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:

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 5 years ago.
get_the_title_attribute.diff (811 bytes) - added by sillybean 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
5 years ago

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

#2 @sillybean
5 years ago

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

#3 @SergeyBiryukov
5 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.