Changeset 28401 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 05/15/2014 01:21:20 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r28399 r28401 1002 1002 $defaults = array( 1003 1003 'depth' => 0, 'show_date' => '', 1004 'date_format' => get_option( 'date_format'),1004 'date_format' => get_option( 'date_format' ), 1005 1005 'child_of' => 0, 'exclude' => '', 1006 'title_li' => __( 'Pages'), 'echo' => 1,1006 'title_li' => __( 'Pages' ), 'echo' => 1, 1007 1007 'authors' => '', 'sort_column' => 'menu_order, post_title', 1008 1008 'link_before' => '', 'link_after' => '', 'walker' => '', … … 1010 1010 1011 1011 $r = wp_parse_args( $args, $defaults ); 1012 extract( $r, EXTR_SKIP );1013 1012 1014 1013 $output = ''; … … 1016 1015 1017 1016 // sanitize, mostly to keep spaces out 1018 $r['exclude'] = preg_replace( '/[^0-9,]/', '', $r['exclude']);1017 $r['exclude'] = preg_replace( '/[^0-9,]/', '', $r['exclude'] ); 1019 1018 1020 1019 // Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array) 1021 $exclude_array = ( $r['exclude'] ) ? explode( ',', $r['exclude']) : array();1020 $exclude_array = ( $r['exclude'] ) ? explode( ',', $r['exclude'] ) : array(); 1022 1021 1023 1022 /** … … 1032 1031 // Query pages. 1033 1032 $r['hierarchical'] = 0; 1034 $pages = get_pages( $r);1035 1036 if ( ! empty($pages) ) {1037 if ( $r['title_li'] ) 1033 $pages = get_pages( $r ); 1034 1035 if ( ! empty( $pages ) ) { 1036 if ( $r['title_li'] ) { 1038 1037 $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>'; 1039 1038 } 1040 1039 global $wp_query; 1041 1040 if ( is_page() || is_attachment() || $wp_query->is_posts_page ) { … … 1048 1047 } 1049 1048 1050 $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r);1051 1052 if ( $r['title_li'] ) 1049 $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r ); 1050 1051 if ( $r['title_li'] ) { 1053 1052 $output .= '</ul></li>'; 1053 } 1054 1054 } 1055 1055 … … 1061 1061 * @see wp_list_pages() 1062 1062 * 1063 * @param string $ outputHTML output of the pages list.1063 * @param string $html HTML output of the pages list. 1064 1064 * @param array $r An array of page-listing arguments. 1065 1065 */ 1066 $output = apply_filters( 'wp_list_pages', $output, $r ); 1067 1068 if ( $r['echo'] ) 1069 echo $output; 1070 else 1071 return $output; 1066 $html = apply_filters( 'wp_list_pages', $output, $r ); 1067 1068 if ( $r['echo'] ) { 1069 echo $html; 1070 } else { 1071 return $html; 1072 } 1072 1073 } 1073 1074
Note: See TracChangeset
for help on using the changeset viewer.