Opened 4 years ago
Closed 4 years ago
#10034 closed enhancement (fixed)
wp_list_pages(): pass args $r to apply_filters()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 2.9 |
| Component: | Template | Version: | 2.8 |
| Severity: | minor | Keywords: | has-patch commit |
| Cc: |
Description
A one line fix:
- $output = apply_filters('wp_list_pages', $output);
+ $output = apply_filters('wp_list_pages', $output, $r);
It would allow filters to test clauses such as 'child_of==0'.
I currently use the following hack in the filter function:
$bt=debug_backtrace();
$r=$bt[3]["args"][0];
Attachments (1)
Change History (8)
antonylesuisse — 4 years ago
- Component changed from General to Template
- Milestone changed from Unassigned to Future Release
- Version set to 2.8
comment:2
follow-up:
↓ 3
Denis-de-Bernardy — 4 years ago
- Keywords needs-patch added
- Priority changed from normal to low
- Severity changed from normal to minor
adding to this, if we pass one argument, we should really pass them all as an array.
comment:3
in reply to:
↑ 2
antonylesuisse — 4 years ago
Replying to Denis-de-Bernardy:
adding to this, if we pass one argument, we should really pass them all as an array.
line 745:
$r = wp_parse_args( $args, $defaults );
$r is already the right array.
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 2.9
my bad, it's late. Thought $r was shorthand for the return param. :P
- Keywords commit added
still applies clean
Note: See
TracTickets for help on using
tickets.

just checking... have you looked into the widget_pages_args hook?