Ticket #13979: wp-page-menu-id-arg.diff
File wp-page-menu-id-arg.diff, 1.8 KB (added by , 14 years ago) |
---|
-
post-template.php
809 809 * <ul> 810 810 * <li><strong>sort_column</strong> - How to sort the list of pages. Defaults 811 811 * to page title. Use column for posts table.</li> 812 * <li><strong>menu_class</strong> - Class to use for the div IDwhich contains812 * <li><strong>menu_class</strong> - Class to use for the div Class which contains 813 813 * the page list. Defaults to 'menu'.</li> 814 * <li><strong>menu_id</strong> - Class to use for the div ID which contains 815 * the page list. Defaults to ''.</li> 814 816 * <li><strong>echo</strong> - Whether to echo list or return it. Defaults to 815 817 * echo.</li> 816 818 * <li><strong>link_before</strong> - Text before show_home argument text.</li> … … 825 827 * @param array|string $args 826 828 */ 827 829 function wp_page_menu( $args = array() ) { 828 $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', ' echo' => true, 'link_before' => '', 'link_after' => '');830 $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'link_before' => '', 'link_after' => ''); 829 831 $args = wp_parse_args( $args, $defaults ); 830 832 $args = apply_filters( 'wp_page_menu_args', $args ); 831 833 … … 860 862 861 863 if ( $menu ) 862 864 $menu = '<ul>' . $menu . '</ul>'; 863 864 $menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n"; 865 866 $menu_id = ''; 867 if ( $args['menu_id'] != '' ) 868 $menu_id = ' id="'. esc_attr($args['menu_id']) .'"'; 869 870 $menu = '<div'. $menu_id .' class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n"; 865 871 $menu = apply_filters( 'wp_page_menu', $menu, $args ); 866 872 if ( $args['echo'] ) 867 873 echo $menu;