Changeset 53157 for trunk/src/wp-includes/blocks/page-list.php
- Timestamp:
- 04/12/2022 03:10:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/page-list.php
r52765 r53157 179 179 } 180 180 181 $title = wp_kses ( $page['title'], wp_kses_allowed_html( 'post' ));181 $title = wp_kses_post( $page['title'] ); 182 182 $aria_label = sprintf( 183 183 /* translators: Accessibility text. %s: Parent page title. */ … … 186 186 ); 187 187 188 $markup .= '<li class="wp-block-pages-list__item' . $css_class. '"' . $style_attribute . '>';188 $markup .= '<li class="wp-block-pages-list__item' . esc_attr( $css_class ) . '"' . $style_attribute . '>'; 189 189 190 190 if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) { 191 $markup .= '<button aria-label="' . $aria_label . '" class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . $title . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>'.192 '</button>' ;191 $markup .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="' . esc_attr( $navigation_child_content_class ) . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . esc_html( $title ) . 192 '</button>' . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>'; 193 193 } else { 194 $markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class. '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>';194 $markup .= '<a class="wp-block-pages-list__item__link' . esc_attr( $navigation_child_content_class ) . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>'; 195 195 } 196 196 197 197 if ( isset( $page['children'] ) ) { 198 198 if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) { 199 $markup .= '<button aria-label="' . $aria_label. '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';200 $markup .= '<s pan class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';199 $markup .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">'; 200 $markup .= '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>'; 201 201 $markup .= '</button>'; 202 202 } … … 236 236 * Renders the `core/page-list` block on server. 237 237 * 238 * @param array $attributes The block attributes.239 * @param array $contentThe saved content.240 * @param array $blockThe parsed block.238 * @param array $attributes The block attributes. 239 * @param string $content The saved content. 240 * @param WP_Block $block The parsed block. 241 241 * 242 242 * @return string Returns the page list markup. … … 253 253 ); 254 254 255 // If th are are no pages, there is nothing to show.255 // If there are no pages, there is nothing to show. 256 256 if ( empty( $all_pages ) ) { 257 257 return;
Note: See TracChangeset
for help on using the changeset viewer.