Opened 6 years ago
Closed 4 years ago
#4531 closed enhancement (fixed)
Add limit parameter to get_pages
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Template | Version: | |
| Severity: | minor | Keywords: | has-patch tested commit |
| Cc: |
Description
add 'numberposts' and 'offset' to get_pages() to allow for limiting of returned posts.
Attachments (3)
Change History (18)
comment:2
Speedboxer — 6 years ago
- Component changed from Administration to Template
- Keywords get_pages has-patch added
comment:3
Speedboxer — 6 years ago
- Keywords changed from get_pages, has-patch to get_pages has-patch
comment:5
in reply to:
↑ 4
;
follow-up:
↓ 8
foolswisdom — 6 years ago
Replying to rob1n:
Why is it 'numberposts'? Why not 'numberpages'?
DD32 commented on wp-hackers about that typo that is in the ticket, but not in the patch.
I think we use "number" in other places. Let's keep it consistent.
The number needs to be cast to an int for security. See how number is used in get_terms().
comment:7
Speedboxer — 6 years ago
- Keywords needs-testing added
Patch 4531-add-limit-parameters-to-get_pages.diff adds offset and number parameters to get_pages().
Replying to foolswisdom:
Replying to rob1n:
Why is it 'numberposts'? Why not 'numberpages'?
DD32 commented on wp-hackers about that typo that is in the ticket, but not in the patch.
See comment 1:
DD32:
'Doh! Sorry, I meant "adds 'numberpages'" in the Description :)
If we want to standarise on 'number' and 'offset' for all functions, then it might be an idea to depreciate "numberposts" in get_posts too:
function get_posts($args) {
global $wpdb;
$defaults = array(
'numberposts' => 5, 'offset' => 0,
comment:10
westi — 5 years ago
- Milestone changed from 2.5 to 2.6
- Owner changed from anonymous to westi
- Status changed from new to assigned
- Type changed from defect to enhancement
comment:11
follow-up:
↓ 12
Denis-de-Bernardy — 4 years ago
still current?
comment:12
in reply to:
↑ 11
Speedboxer — 4 years ago
- Keywords tested commit added; get_pages needs-testing removed
- Milestone changed from 2.9 to 2.8
patch is harmless
I *am* wondering how this is useful, though. :D
comment:15
westi — 4 years ago
- Resolution set to fixed
- Status changed from assigned to closed

Adds numberpages and offset to get_pages