Changeset 52324 for trunk/src/wp-includes/blocks/navigation-submenu.php
- Timestamp:
- 12/06/2021 06:18:27 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/navigation-submenu.php
r52232 r52324 164 164 ) 165 165 ); 166 $html = '<li ' . $wrapper_attributes . '>'; 166 167 $label = ''; 168 169 if ( isset( $attributes['label'] ) ) { 170 $label .= wp_kses( 171 $attributes['label'], 172 array( 173 'code' => array(), 174 'em' => array(), 175 'img' => array( 176 'scale' => array(), 177 'class' => array(), 178 'style' => array(), 179 'src' => array(), 180 'alt' => array(), 181 ), 182 's' => array(), 183 'span' => array( 184 'style' => array(), 185 ), 186 'strong' => array(), 187 ) 188 ); 189 } 190 191 $html = '<li ' . $wrapper_attributes . '>'; 167 192 168 193 // If Submenus open on hover, we render an anchor tag with attributes. … … 194 219 // End appending HTML attributes to anchor tag. 195 220 196 if ( isset( $attributes['label'] ) ) { 197 $html .= wp_kses( 198 $attributes['label'], 199 array( 200 'code' => array(), 201 'em' => array(), 202 'img' => array( 203 'scale' => array(), 204 'class' => array(), 205 'style' => array(), 206 'src' => array(), 207 'alt' => array(), 208 ), 209 's' => array(), 210 'span' => array( 211 'style' => array(), 212 ), 213 'strong' => array(), 214 ) 215 ); 216 } 221 $html .= $label; 217 222 218 223 $html .= '</a>'; … … 222 227 // The submenu icon is rendered in a button here 223 228 // so that there's a clickable elment to open the submenu. 224 $html .= '<button class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';229 $html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>'; 225 230 } 226 231 } else { 227 232 // If menus open on click, we render the parent as a button. 228 $html .= '<button class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';233 $html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">'; 229 234 230 235 // Wrap title with span to isolate it from submenu icon. 231 236 $html .= '<span class="wp-block-navigation-item__label">'; 232 237 233 if ( isset( $attributes['label'] ) ) { 234 $html .= wp_kses( 235 $attributes['label'], 236 array( 237 'code' => array(), 238 'em' => array(), 239 'img' => array( 240 'scale' => array(), 241 'class' => array(), 242 'style' => array(), 243 'src' => array(), 244 'alt' => array(), 245 ), 246 's' => array(), 247 'span' => array( 248 'style' => array(), 249 ), 250 'strong' => array(), 251 ) 252 ); 253 } 238 $html .= $label; 254 239 255 240 $html .= '</span>';
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)