Opened 17 years ago
Closed 17 years ago
#9636 closed enhancement (fixed)
get_lastpost* functions only look at post_status
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8 | Priority: | normal |
| Severity: | normal | Version: | 2.8 |
| Component: | General | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
The get_lastpostdate and get_lastpostmodified functions only use post_status='publish' in the query. According to the name of the function, shouldn't they look for post_type='post'?
Possible solutions:
- Modify current functions to only query posts, create another set of functions get_lastpage* to query pages, and a generic set that uses current logic
- Add a parameter to the current functions to limit by posts or pages.
Attachments (3)
Change History (10)
#2
@
17 years ago
- Keywords has-patch added; date posts pages removed
seems valid except in one case. the two functions only get used in feed-related code, to conditionally serve the feed. the exception is in the next patch.
#5
@
17 years ago
On a separate note, those queries are potentially dead slow -- leading to a seq scan of the entire table, from lack of any potential index.
Note: See
TracTickets for help on using
tickets.
A post_type option that defaults to 'post' seems good.