Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make wp_list_pages query filterable. #2

Closed
wants to merge 2 commits into from

2 participants

@DrewAPicture

It would be nice to make the wp_list_pages() query filterable so, for instance, I can filter based on post meta or other args.

I tried to follow your style so the wp_parse_args got bundled in with the trim on line 637. Could split it out as its own line if you favor readability over succinctness.

@DrewAPicture

Take a look at 94104d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  wp-help.php
View
3  wp-help.php
@@ -633,7 +633,8 @@ public function page_link( $link, $post ) {
private function get_help_topics_html( $with_sort_handles = false ) {
if ( $with_sort_handles )
$this->filter_wp_list_pages = true;
- $output = trim( wp_list_pages( array( 'post_type' => self::POST_TYPE, 'hierarchical' => true, 'echo' => false, 'title_li' => '' ) ) );
+ $defaults = array( 'post_type' => self::POST_TYPE, 'hierarchical' => true, 'echo' => false, 'title_li' => '' );
+ $output = trim( wp_list_pages( apply_filters( 'cws_wp_help_list_pages', $defaults ) ) );
$this->filter_wp_list_pages = false;
return $output;
}
Something went wrong with that request. Please try again.