Make WordPress Core


Ignore:
Timestamp:
10/15/2017 09:42:52 PM (7 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-calendar.php

    r41162 r41867  
    5050     */
    5151    public function widget( $args, $instance ) {
     52        $title = ! empty( $instance['title'] ) ? $instance['title'] : '';
     53
    5254        /** 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 );
    5456
    5557        echo $args['before_widget'];
Note: See TracChangeset for help on using the changeset viewer.