Changeset 52364 for trunk/src/wp-includes/blocks/page-list.php
- Timestamp:
- 12/14/2021 01:55:28 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/page-list.php
r52324 r52364 174 174 } 175 175 176 $title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) ); 176 $title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) ); 177 $aria_label = sprintf( 178 /* translators: Accessibility text. %s: Parent page title. */ 179 __( '%s submenu' ), 180 $title 181 ); 177 182 178 183 $markup .= '<li class="wp-block-pages-list__item' . $css_class . '"' . $style_attribute . '>'; 179 184 180 185 if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) { 181 $markup .= '<button aria-label="' . $ title . ' ' . __( 'submenu', 'gutenberg' ). '" 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>' .186 $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>' . 182 187 '</button>'; 183 188 } else { … … 187 192 if ( isset( $page['children'] ) ) { 188 193 if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) { 189 $markup .= '<button aria-label="' . $ title . ' ' . __( 'submenu', 'gutenberg' ). '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';194 $markup .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">'; 190 195 $markup .= '<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>'; 191 196 $markup .= '</button>';
Note: See TracChangeset
for help on using the changeset viewer.