Opened 10 years ago
Closed 10 years ago
#27834 closed defect (bug) (fixed)
wp_get_archives invalid query
Reported by: | westi | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Posts, Post Types | Keywords: | good-first-bug has-patch needs-testing |
Focuses: | template | Cc: |
Description
wp_get_archives( array( 'limit' => 0 ) );
Generates:
SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC 0
We should just ignore a limit of 0 and fallback to the default IMHO
Attachments (2)
Change History (5)
#1
@
10 years ago
- Keywords has-patch needs-testing added; needs-patch needs-unit-tests removed
Added logic that checks for 0 and sets it to the default. My first unit test for core, so feedback is welcome.
Note: See
TracTickets for help on using
tickets.
27834 unit tests