Changeset 48349 for trunk/src/wp-includes/widgets/class-wp-widget-pages.php
- Timestamp:
- 07/06/2020 08:42:14 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-pages.php
r47593 r48349 41 41 */ 42 42 public function widget( $args, $instance ) { 43 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Pages' ); 43 $default_title = __( 'Pages' ); 44 $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title; 44 45 45 46 /** … … 90 91 echo $args['before_title'] . $title . $args['after_title']; 91 92 } 93 94 $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; 95 96 /** 97 * Filters the HTML format of widgets with navigation links. 98 * 99 * @since 5.5.0 100 * 101 * @param string $format The type of markup to use in widgets with navigation links. 102 * Accepts 'html5', 'xhtml'. 103 */ 104 $format = apply_filters( 'navigation_widgets_format', $format ); 105 106 if ( 'html5' === $format ) { 107 // The title may be filtered: Strip out HTML and make sure the aria-label is never empty. 108 $title = trim( strip_tags( $title ) ); 109 $aria_label = $title ? $title : $default_title; 110 echo '<nav role="navigation" aria-label="' . esc_attr( $aria_label ) . '">'; 111 } 92 112 ?> 93 <ul> 94 <?php echo $out; ?> 95 </ul> 113 114 <ul> 115 <?php echo $out; ?> 116 </ul> 117 118 <?php if ( 'html5' === $format ) : ?> 119 </nav> 120 <?php endif; ?> 121 96 122 <?php 97 123 echo $args['after_widget'];
Note: See TracChangeset
for help on using the changeset viewer.