Changeset 41867
- Timestamp:
- 10/15/2017 09:42:52 PM (7 years ago)
- Location:
- trunk/src/wp-includes/widgets
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php
r41162 r41867 43 43 $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false; 44 44 45 if ( ! $nav_menu )45 if ( ! $nav_menu ) { 46 46 return; 47 } 48 49 $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; 47 50 48 51 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 49 $ instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );52 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 50 53 51 54 echo $args['before_widget']; 52 55 53 if ( !empty($instance['title']) ) 54 echo $args['before_title'] . $instance['title'] . $args['after_title']; 56 if ( $title ) { 57 echo $args['before_title'] . $title . $args['after_title']; 58 } 55 59 56 60 $nav_menu_args = array( -
trunk/src/wp-includes/widgets/class-wp-widget-archives.php
r41685 r41867 41 41 */ 42 42 public function widget( $args, $instance ) { 43 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Archives' ); 44 45 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 46 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 47 43 48 $c = ! empty( $instance['count'] ) ? '1' : '0'; 44 49 $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; 45 50 46 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 47 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives' ) : $instance['title'], $instance, $this->id_base ); 51 echo $args['before_widget']; 48 52 49 echo $args['before_widget'];50 53 if ( $title ) { 51 54 echo $args['before_title'] . $title . $args['after_title']; -
trunk/src/wp-includes/widgets/class-wp-widget-calendar.php
r41162 r41867 50 50 */ 51 51 public function widget( $args, $instance ) { 52 $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; 53 52 54 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 53 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );55 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 54 56 55 57 echo $args['before_widget']; -
trunk/src/wp-includes/widgets/class-wp-widget-categories.php
r41685 r41867 45 45 static $first_dropdown = true; 46 46 47 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Categories' ); 48 47 49 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 48 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base );50 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 49 51 50 52 $c = ! empty( $instance['count'] ) ? '1' : '0'; … … 53 55 54 56 echo $args['before_widget']; 57 55 58 if ( $title ) { 56 59 echo $args['before_title'] . $title . $args['after_title']; -
trunk/src/wp-includes/widgets/class-wp-widget-meta.php
r41685 r41867 43 43 */ 44 44 public function widget( $args, $instance ) { 45 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' ); 46 45 47 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 46 $title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Meta' ) : $instance['title'], $instance, $this->id_base );48 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 47 49 48 50 echo $args['before_widget']; 51 49 52 if ( $title ) { 50 53 echo $args['before_title'] . $title . $args['after_title']; … … 76 79 </ul> 77 80 <?php 81 78 82 echo $args['after_widget']; 79 83 } -
trunk/src/wp-includes/widgets/class-wp-widget-pages.php
r41685 r41867 41 41 */ 42 42 public function widget( $args, $instance ) { 43 $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Pages' ); 43 44 44 45 /** … … 51 52 * @param mixed $id_base The widget ID. 52 53 */ 53 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Pages' ) : $instance['title'], $instance, $this->id_base );54 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 54 55 55 56 $sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby']; -
trunk/src/wp-includes/widgets/class-wp-widget-rss.php
r41162 r41867 69 69 } 70 70 71 if ( empty($title) ) 72 $title = empty($desc) ? __('Unknown Feed') : $desc; 71 if ( empty( $title ) ) { 72 $title = ! empty( $desc ) ? $desc : __( 'Unknown Feed' ); 73 } 73 74 74 75 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ -
trunk/src/wp-includes/widgets/class-wp-widget-search.php
r41162 r41867 41 41 */ 42 42 public function widget( $args, $instance ) { 43 $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; 44 43 45 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 44 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );46 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 45 47 46 48 echo $args['before_widget']; -
trunk/src/wp-includes/widgets/class-wp-widget-tag-cloud.php
r41685 r41867 40 40 */ 41 41 public function widget( $args, $instance ) { 42 $current_taxonomy = $this->_get_current_taxonomy($instance); 43 if ( !empty($instance['title']) ) { 42 $current_taxonomy = $this->_get_current_taxonomy( $instance ); 43 44 if ( ! empty( $instance['title'] ) ) { 44 45 $title = $instance['title']; 45 46 } else { 46 if ( 'post_tag' == $current_taxonomy ) {47 $title = __( 'Tags');47 if ( 'post_tag' === $current_taxonomy ) { 48 $title = __( 'Tags' ); 48 49 } else { 49 $tax = get_taxonomy( $current_taxonomy);50 $tax = get_taxonomy( $current_taxonomy ); 50 51 $title = $tax->labels->name; 51 52 } -
trunk/src/wp-includes/widgets/class-wp-widget-text.php
r41779 r41867 193 193 global $post; 194 194 195 $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; 196 195 197 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ 196 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );198 $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); 197 199 198 200 $text = ! empty( $instance['text'] ) ? $instance['text'] : '';
Note: See TracChangeset
for help on using the changeset viewer.