#1270 closed enhancement (fixed)
Add "echo" option to wp_list_pages ( as well as _page_level_out() )
Reported by: | MC_incubus | Owned by: | ryan |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 1.5.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
wp_list_pages() and _page_level_out() both have hardcoded echoes. The enclosed patch gives each an echo switch, while maintaining backwards compat.
Attachments (1)
Change History (7)
#4
@
20 years ago
Well, the use case for me was that I wanted to use wp_list_pages() in a 'the_content' filter. Wrote a plugin that replaces <!--subpages--> with the list of pages under that current page (had a lot of requests for this).
So I need to be able to do a str_replace() to put in wp_list_pages() for <!--subpages-->
Yes, I could make a copy of the function, rename it, and modify it... but that seems silly when all I need is wp_list_pages() with a return instead of an echo.
#5
@
20 years ago
- fixed_in_version set to 1.5.1
- Owner changed from anonymous to rboren
- Resolution changed from 10 to 20
- Status changed from new to closed
Okay. It's in there.
This ticket was mentioned in Slack in #core-coding-standards by jrf. View the logs.
6 years ago
Note: See
TracTickets for help on using
tickets.
What's the use case? Someone who doesn't want to echo would probably be using get_pages() so that they could do their own thing, yes?