Timeline for Draft standard post by ACF Data picker
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 13 at 18:55 | comment | added | CommunityBot | Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. | |
Nov 13 at 12:50 | answer | added | vektor | timeline score: 2 | |
Nov 13 at 12:19 | comment | added | Tom J Nowell♦ | also, the format you store the date in matters if you're going to have MySQL do the comparison. How you'd compare a date that's a string is a general PHP problem rather than a WordPress problem | |
Nov 13 at 12:18 | comment | added | Tom J Nowell♦ |
you can't compare dates using strings, if ( "2024/01/01" < "2025/01/01" ) { doesn't work. The reason some code can do this is because it's handling dates as numbers e.g. seconds since the Unix epoch, not as strings. The code in your question won't scale anyway, it's easier and simpler to do this using meta_query so that MySQL does the date comparison, and to avoid setting posts_per_page to -1 as it means this feature will break once you publish more than a few hundred posts. You might also want to specify the published post status explicitly
|
|
S Nov 13 at 11:50 | review | First questions | |||
Nov 13 at 18:55 | |||||
S Nov 13 at 11:50 | history | asked | vektor | CC BY-SA 4.0 |