Changeset 28399 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 05/15/2014 01:11:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r28398 r28399 919 919 * @return string HTML content, if not displaying. 920 920 */ 921 function wp_dropdown_pages( $args = '') {921 function wp_dropdown_pages( $args = '' ) { 922 922 $defaults = array( 923 923 'depth' => 0, 'child_of' => 0, … … 929 929 930 930 $r = wp_parse_args( $args, $defaults ); 931 extract( $r, EXTR_SKIP ); 932 933 $pages = get_pages($r); 931 932 $pages = get_pages( $r ); 934 933 $output = ''; 935 934 // Back-compat with old system where both id and name were based on $name argument 936 if ( empty($id) ) 937 $id = $name; 938 939 if ( ! empty($pages) ) { 940 $output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'>\n"; 941 if ( $show_option_no_change ) 942 $output .= "\t<option value=\"-1\">$show_option_no_change</option>"; 943 if ( $show_option_none ) 944 $output .= "\t<option value=\"" . esc_attr($option_none_value) . "\">$show_option_none</option>\n"; 945 $output .= walk_page_dropdown_tree($pages, $depth, $r); 935 if ( empty( $r['id'] ) ) { 936 $r['id'] = $r['name']; 937 } 938 939 if ( ! empty( $pages ) ) { 940 $output = "<select name='" . esc_attr( $r['name'] ) . "' id='" . esc_attr( $r['id'] ) . "'>\n"; 941 if ( $r['show_option_no_change'] ) { 942 $output .= "\t<option value=\"-1\">" . $r['show_option_no_change'] . "</option>\n"; 943 } 944 if ( $r['show_option_none'] ) { 945 $output .= "\t<option value=\"" . esc_attr( $r['option_none_value'] ) . '">' . $r['show_option_none'] . "</option>\n"; 946 } 947 $output .= walk_page_dropdown_tree( $pages, $r['depth'], $r ); 946 948 $output .= "</select>\n"; 947 949 } … … 952 954 * @since 2.1.0 953 955 * 954 * @param string $ outputHTML output for drop down list of pages.955 */ 956 $ output= apply_filters( 'wp_dropdown_pages', $output );957 958 if ( $ echo )959 echo $ output;960 961 return $ output;956 * @param string $html HTML output for drop down list of pages. 957 */ 958 $html = apply_filters( 'wp_dropdown_pages', $output ); 959 960 if ( $r['echo'] ) { 961 echo $html; 962 } 963 return $html; 962 964 } 963 965
Note: See TracChangeset
for help on using the changeset viewer.