Ticket #13998: 13998_wp_page_menu_incosistence_2.patch
File 13998_wp_page_menu_incosistence_2.patch, 2.0 KB (added by , 14 years ago) |
---|
-
wp-includes/post-template.php
840 840 * <ul> 841 841 * <li><strong>sort_column</strong> - How to sort the list of pages. Defaults 842 842 * to page title. Use column for posts table.</li> 843 * <li><strong>menu_class</strong> - Class to use for the div ID which contains 844 * the page list. Defaults to 'menu'.</li> 843 * <li><strong>container_class</strong> - Class that is applied to the container. 844 * <li><strong>menu_class</strong> - Class that is applied to the ul element which 845 * forms the menu. Defaults to 'menu'.</li> 845 846 * <li><strong>echo</strong> - Whether to echo list or return it. Defaults to 846 847 * echo.</li> 847 848 * <li><strong>link_before</strong> - Text before show_home argument text.</li> … … 856 857 * @param array|string $args 857 858 */ 858 859 function wp_page_menu( $args = array() ) { 859 $defaults = array('sort_column' => 'menu_order, post_title', ' menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');860 $defaults = array('sort_column' => 'menu_order, post_title', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => ''); 860 861 $args = wp_parse_args( $args, $defaults ); 861 862 $args = apply_filters( 'wp_page_menu_args', $args ); 862 863 … … 889 890 $list_args['title_li'] = ''; 890 891 $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); 891 892 892 if ( $menu )893 $menu = '<ul>' . $menu . '</ul>';893 $class = $args['menu_class'] ? ' class="'. $args['menu_class'] .'"' : ''; 894 $menu = '<ul' . $class . '>' . $menu . '</ul>'; 894 895 895 $menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n"; 896 $class = $args['container_class'] ? ' class="' . esc_attr( $args['container_class'] ) . '"' : ''; 897 $menu = '<div' . $class . '>' . $menu . "</div>\n"; 896 898 $menu = apply_filters( 'wp_page_menu', $menu, $args ); 897 899 if ( $args['echo'] ) 898 900 echo $menu;