diff --git a/src/wp-includes/class-walker-page.php b/src/wp-includes/class-walker-page.php
index 119ea6e..2cc2ddb 100644
a
|
b
|
class Walker_Page extends Walker { |
133 | 133 | |
134 | 134 | /** This filter is documented in wp-includes/post-template.php */ |
135 | 135 | $output .= $indent . sprintf( |
136 | | '<li class="%s"><a href="%s">%s%s%s</a>', |
| 136 | '%s<li class="%s"><a href="%s">%s%s%s</a>', |
| 137 | $args['item_before'], |
137 | 138 | $css_classes, |
138 | 139 | get_permalink( $page->ID ), |
139 | 140 | $args['link_before'], |
… |
… |
class Walker_Page extends Walker { |
166 | 167 | * @param array $args |
167 | 168 | */ |
168 | 169 | public function end_el( &$output, $page, $depth = 0, $args = array() ) { |
169 | | $output .= "</li>\n"; |
| 170 | $output .= "</li>" . $args['item_after']; |
170 | 171 | } |
171 | 172 | |
172 | 173 | } |
diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php
index 253b654..5cc86d2 100644
a
|
b
|
class Walker_Nav_Menu extends Walker { |
124 | 124 | $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth ); |
125 | 125 | $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; |
126 | 126 | |
127 | | $output .= $indent . '<li' . $id . $class_names .'>'; |
| 127 | $output .= $indent . $args->item_before . '<li' . $id . $class_names .'>'; |
128 | 128 | |
129 | 129 | $atts = array(); |
130 | 130 | $atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : ''; |
… |
… |
class Walker_Nav_Menu extends Walker { |
211 | 211 | * @param array $args An array of arguments. @see wp_nav_menu() |
212 | 212 | */ |
213 | 213 | public function end_el( &$output, $item, $depth = 0, $args = array() ) { |
214 | | $output .= '</li>'; |
| 214 | $output .= '</li>' . $args->item_after; |
215 | 215 | } |
216 | 216 | |
217 | 217 | } // Walker_Nav_Menu |
… |
… |
class Walker_Nav_Menu extends Walker { |
239 | 239 | * @type string $after Text after the link text. Default empty. |
240 | 240 | * @type string $link_before Text before the link. Default empty. |
241 | 241 | * @type string $link_after Text after the link. Default empty. |
| 242 | * @type string $item_before Text before the list item. Default empty. |
| 243 | * @type string $item_after Text after the list item. Default is a line break. |
242 | 244 | * @type bool $echo Whether to echo the menu or return it. Default true. |
243 | 245 | * @type int $depth How many levels of the hierarchy are to be included. 0 means all. Default 0. |
244 | 246 | * @type object $walker Instance of a custom walker class. Default empty. |
… |
… |
function wp_nav_menu( $args = array() ) { |
254 | 256 | |
255 | 257 | $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', |
256 | 258 | 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', |
| 259 | 'item_before' => '', 'item_after' => "\n", |
257 | 260 | 'depth' => 0, 'walker' => '', 'theme_location' => '' ); |
258 | 261 | |
259 | 262 | $args = wp_parse_args( $args, $defaults ); |
diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
index ed2ce12..bbb2450 100644
a
|
b
|
function wp_dropdown_pages( $args = '' ) { |
1111 | 1111 | * @type array $include Comma-separated list of page IDs to include. Default empty. |
1112 | 1112 | * @type string $link_after Text or HTML to follow the page link label. Default null. |
1113 | 1113 | * @type string $link_before Text or HTML to precede the page link label. Default null. |
| 1114 | * @type string $item_before Text before the list item. Default empty. |
| 1115 | * @type string $item_after Text after the list item. Default is a line break. |
1114 | 1116 | * @type string $post_type Post type to query for. Default 'page'. |
1115 | 1117 | * @type string $post_status Comma-separated list of post statuses to include. Default 'publish'. |
1116 | 1118 | * @type string $show_date Whether to display the page publish or modified date for each page. Accepts |
… |
… |
function wp_list_pages( $args = '' ) { |
1132 | 1134 | 'title_li' => __( 'Pages' ), 'echo' => 1, |
1133 | 1135 | 'authors' => '', 'sort_column' => 'menu_order, post_title', |
1134 | 1136 | 'link_before' => '', 'link_after' => '', 'walker' => '', |
| 1137 | 'item_before' => '', 'item_after' => "\n", |
1135 | 1138 | ); |
1136 | 1139 | |
1137 | 1140 | $r = wp_parse_args( $args, $defaults ); |
… |
… |
function wp_list_pages( $args = '' ) { |
1160 | 1163 | |
1161 | 1164 | if ( ! empty( $pages ) ) { |
1162 | 1165 | if ( $r['title_li'] ) { |
1163 | | $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>'; |
| 1166 | $output .= $r['item_before'] . '<li class="pagenav">' . $r['title_li'] . '<ul>'; |
1164 | 1167 | } |
1165 | 1168 | global $wp_query; |
1166 | 1169 | if ( is_page() || is_attachment() || $wp_query->is_posts_page ) { |
… |
… |
function wp_list_pages( $args = '' ) { |
1175 | 1178 | $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r ); |
1176 | 1179 | |
1177 | 1180 | if ( $r['title_li'] ) { |
1178 | | $output .= '</ul></li>'; |
| 1181 | $output .= '</ul></li>' . $r['item_after']; |
1179 | 1182 | } |
1180 | 1183 | } |
1181 | 1184 | |
… |
… |
function wp_list_pages( $args = '' ) { |
1224 | 1227 | * you'd like shown for the home link. 1|true defaults to 'Home'. |
1225 | 1228 | * @type string $link_before The HTML or text to prepend to $show_home text. Default empty. |
1226 | 1229 | * @type string $link_after The HTML or text to append to $show_home text. Default empty. |
| 1230 | * @type string $item_before Text before the list item. Default empty. |
| 1231 | * @type string $item_after Text after the list item. Default is a line break. |
1227 | 1232 | * @type string $before The HTML or text to prepend to the menu. Default is '<ul>'. |
1228 | 1233 | * @type string $after The HTML or text to append to the menu. Default is '</ul>'. |
1229 | 1234 | * @type Walker $walker Walker instance to use for listing pages. Default empty (Walker_Page). |
… |
… |
function wp_page_menu( $args = array() ) { |
1239 | 1244 | 'echo' => true, |
1240 | 1245 | 'link_before' => '', |
1241 | 1246 | 'link_after' => '', |
| 1247 | 'item_before' => '', |
| 1248 | 'item_after' => "\n", |
1242 | 1249 | 'before' => '<ul>', |
1243 | 1250 | 'after' => '</ul>', |
1244 | 1251 | 'walker' => '', |
… |
… |
function wp_page_menu( $args = array() ) { |
1269 | 1276 | $class = ''; |
1270 | 1277 | if ( is_front_page() && !is_paged() ) |
1271 | 1278 | $class = 'class="current_page_item"'; |
1272 | | $menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>'; |
| 1279 | $menu .= $args['item_before'] . '<li ' . $class . '><a href="' . home_url( '/' ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>' . $args['item_after']; |
1273 | 1280 | // If the front page is a page, add it to the exclude list |
1274 | 1281 | if (get_option('show_on_front') == 'page') { |
1275 | 1282 | if ( !empty( $list_args['exclude'] ) ) { |
… |
… |
function wp_page_menu( $args = array() ) { |
1281 | 1288 | } |
1282 | 1289 | } |
1283 | 1290 | |
1284 | | $list_args['echo'] = false; |
1285 | | $list_args['title_li'] = ''; |
1286 | | $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) ); |
| 1291 | $list_args['echo'] = false; |
| 1292 | $list_args['title_li'] = ''; |
| 1293 | $list_args['item_before'] = $args['item_before']; |
| 1294 | $list_args['item_after'] = $args['item_after']; |
| 1295 | $menu .= wp_list_pages($list_args); |
1287 | 1296 | |
1288 | 1297 | $container = sanitize_text_field( $args['container'] ); |
1289 | 1298 | |