Ticket #31656: 31656.diff
File 31656.diff, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-includes/post-template.php
1187 1187 * arguments. 1188 1188 * 1189 1189 * @since 2.7.0 1190 * @since 4.4.0 Added ` container`, `before`, `after`, and `walker` arguments.1190 * @since 4.4.0 Added `menu_id`, `container`, `before`, `after`, and `walker` arguments. 1191 1191 * 1192 1192 * @param array|string $args { 1193 1193 * Optional. Arguments to generate a page menu. See wp_list_pages() for additional arguments. … … 1194 1194 * 1195 1195 * @type string $sort_column How to short the list of pages. Accepts post column names. 1196 1196 * Default 'menu_order, post_title'. 1197 * @type string $menu_id ID for the div containing the page list. Default is empty string. 1197 1198 * @type string $menu_class Class to use for the element containing the page list. Default 'menu'. 1198 1199 * @type string $container Element to use for the element containing the page list. Default 'div'. 1199 1200 * @type bool $echo Whether to echo the list or return it. Accepts true (echo) or false (return). … … 1211 1212 function wp_page_menu( $args = array() ) { 1212 1213 $defaults = array( 1213 1214 'sort_column' => 'menu_order, post_title', 1215 'menu_id' => '', 1214 1216 'menu_class' => 'menu', 1215 1217 'container' => 'div', 1216 1218 'echo' => true, … … 1267 1269 $menu = $args['before'] . $menu . $args['after']; 1268 1270 } 1269 1271 $container = sanitize_text_field( $args['container'] ); 1270 $menu = "<{$container} class=\"" . esc_attr( $args['menu_class'] ) . '">' . $menu . "</{$container}>\n"; 1272 $attrs = ''; 1273 if ( ! empty( $args['menu_id'] ) ) { 1274 $attrs .= ' id="' . esc_attr( $args['menu_id'] ) . '"'; 1275 } 1271 1276 1277 if ( ! empty( $args['menu_class'] ) ) { 1278 $attrs .= ' class="' . esc_attr( $args['menu_class'] ) . '"'; 1279 } 1280 1281 $menu = "<{$container}{$attrs}>" . $menu . "</{$container}>\n"; 1282 1272 1283 /** 1273 1284 * Filter the HTML output of a page-based menu. 1274 1285 *