Changeset 40565
- Timestamp:
- 05/01/2017 11:31:16 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-walker-page.php
r39949 r40565 161 161 $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; 162 162 163 $atts = array(); 164 $atts['href'] = get_permalink( $page->ID ); 165 166 /** 167 * Filters the HTML attributes applied to a page menu item's anchor element. 168 * 169 * @since 4.8.0 170 * 171 * @param array $atts { 172 * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored. 173 * 174 * @type string $href The href attribute. 175 * } 176 * @param WP_Post $page Page data object. 177 * @param int $depth Depth of page, used for padding. 178 * @param array $args An array of arguments. 179 * @param int $current_page ID of the current page. 180 */ 181 $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page ); 182 183 $attributes = ''; 184 foreach ( $atts as $attr => $value ) { 185 if ( ! empty( $value ) ) { 186 $value = esc_attr( $value ); 187 $attributes .= ' ' . $attr . '="' . $value . '"'; 188 } 189 } 190 163 191 $output .= $indent . sprintf( 164 '<li class="%s"><a href="%s">%s%s%s</a>',192 '<li class="%s"><a%s>%s%s%s</a>', 165 193 $css_classes, 166 get_permalink( $page->ID ),194 $attributes, 167 195 $args['link_before'], 168 196 /** This filter is documented in wp-includes/post-template.php */
Note: See TracChangeset
for help on using the changeset viewer.