WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/15/2017 09:42:52 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Widgets: Move empty title checks out of the apply_filters( 'widget_title' ) calls for clarity.

See #42226.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-categories.php

    r41685 r41867  
    4545        static $first_dropdown = true;
    4646
     47        $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Categories' );
     48
    4749        /** 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 );
    4951
    5052        $c = ! empty( $instance['count'] ) ? '1' : '0';
     
    5355
    5456        echo $args['before_widget'];
     57
    5558        if ( $title ) {
    5659            echo $args['before_title'] . $title . $args['after_title'];
Note: See TracChangeset for help on using the changeset viewer.