Make WordPress Core

Ticket #10968: 10968.diff

File 10968.diff, 1.5 KB (added by wonderboymusic, 10 years ago)
  • src/wp-includes/post-template.php

     
    11951195 *     @type string          $sort_column How to short the list of pages. Accepts post column names.
    11961196 *                                        Default 'menu_order, post_title'.
    11971197 *     @type string          $menu_class  Class to use for the div ID containing the page list. Default 'menu'.
     1198 *     @type string          $menu_tag    Element to use for the element containing the page list. Default 'div'.
    11981199 *     @type bool            $echo        Whether to echo the list or return it. Accepts true (echo) or false (return).
    11991200 *                                        Default true.
    12001201 *     @type int|bool|string $show_home   Whether to display the link to the home page. Can just enter the text
     
    12111212        $defaults = array(
    12121213                'sort_column' => 'menu_order, post_title',
    12131214                'menu_class'  => 'menu',
     1215                'menu_tag'    => 'div',
    12141216                'echo'        => true,
    12151217                'show_home'   => false,
    12161218                'link_before' => '',
     
    12641266        if ( $menu ) {
    12651267                $menu = $args['before'] . $menu . $args['after'];
    12661268        }
    1267         $menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n";
     1269        $tag = sanitize_text_field( $args['menu_tag'] );
     1270        $menu = "<{$args['menu_tag']} class=\"" . esc_attr( $args['menu_class'] ) . '">' . $menu . "</{$args['menu_tag']}>\n";
    12681271
    12691272        /**
    12701273         * Filter the HTML output of a page-based menu.