Opened 8 years ago
Last modified 6 years ago
#40790 new enhancement
Ability to filter $post_type in _get_last_post_time
Reported by: | toddlevy | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.7.5 |
Component: | General | Keywords: | has-patch needs-testing dev-feedback |
Focuses: | Cc: |
Description
This function starts on line 5610 of
https://github.com/WordPress/WordPress/blob/4.7.5/wp-includes/post.php
Currently, there is no way to filter the $post_type
argument of the _get_last_post_time
function.
This creates situations where it's impossible to filter/modify the default post type when _get_last_post_time
is called without the $post_type
argument.
Suggested enhancement is to add a _get_last_post_time_post_type
filter inside the _get_last_post_time
function, right after the $field
is validated or the timezone gets lowercased.
Something like this...
$post_type = apply_filters( '_get_last_post_time_post_type', $post_type );
Thank you for considering this enhancement.
Attachments (1)
Change History (6)
#3
@
6 years ago
@toddlevy,
I see you already have suggested a solution. You can create a patch yourself and add it to your ticket!
Add filter
_get_last_post_time_post_type