Make WordPress Core

Ticket #31656: 31656.2.patch

File 31656.2.patch, 1.7 KB (added by ocean90, 10 years ago)

Without sanitize_html_class()

  • src/wp-includes/post-template.php

     
    11431143 *     @type string          $sort_column How to short the list of pages. Accepts post column names.
    11441144 *                                        Default 'menu_order, post_title'.
    11451145 *     @type string          $menu_class  Class to use for the div ID containing the page list. Default 'menu'.
     1146 *     @type string          $menu_id     ID for the div containing the page list. Default is empty string.
    11461147 *     @type bool            $echo        Whether to echo the list or return it. Accepts true (echo) or false (return).
    11471148 *                                        Default true.
    11481149 *     @type string          $link_before The HTML or text to prepend to $show_home text. Default empty.
     
    11531154 * @return string html menu
    11541155 */
    11551156function wp_page_menu( $args = array() ) {
    1156         $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
     1157        $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'link_before' => '', 'link_after' => '');
    11571158        $args = wp_parse_args( $args, $defaults );
    11581159
    11591160        /**
     
    11991200        if ( $menu )
    12001201                $menu = '<ul>' . $menu . '</ul>';
    12011202
    1202         $menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n";
     1203        $menu = '<div class="' . esc_attr( $menu_class ) . '" id="' . esc_attr( $menu_id ) . '">' . $menu . "</div>\n";
    12031204
    12041205        /**
    12051206         * Filter the HTML output of a page-based menu.