Opened 10 years ago
Last modified 5 years ago
#29014 new enhancement
Normalization of template tag filters
Reported by: | Funkatronic | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | template | Cc: |
Description
The filters for the template tags, specifically, title, content and excerpt, are not very uniform. Some of them have a filter for their get_the
variant, but not others. Only the_title
sends the post id through the filter while the others do not.
The included patch does the following:
- Add
get_the
filters to the proper functions forget_the_title
,get_the_content
,get_the_excerpt
- Added post_type specific variants of the filters ( ex.
the_title_{$post->post_type}
- All filters now pass the post id as a second argument
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
A very good idea for example for a cases when you want to hook the_content but also want to add some conditional logic based on the post type.