[wp-trac] [WordPress Trac] #52761: Date Permalinks
WordPress Trac
noreply at wordpress.org
Wed Mar 10 14:41:43 UTC 2021
#52761: Date Permalinks
-------------------------+------------------------------
Reporter: dshanske | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by Rarst):
> built in functions to figure out what date archive the current retrieved
URL is
`is_date()`, `is_day()`, and several more, see
[https://developer.wordpress.org/themes/basics/conditional-tags/#a-date-
page a date page in conditional tags]. Global `$wp_query` would have query
variables of which specific date is it.
> to generate the permalinks to a day, month, or year archive based
`get_day_link()`, `get_month_link()`, `get_year_link()`
Day before/after isn't trivial because there might be ''no posts'' in
them. `get_adjacent_post()` can be used to figure that out, but it gets
clunky.
Would that be enough for your needs?
Or please suggest how would you envision a specific function that covers
something that is currently missing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52761#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list