Make WordPress Core


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

    r41685 r41867  
    4343     */
    4444    public function widget( $args, $instance ) {
     45        $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Meta' );
     46
    4547        /** 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 );
    4749
    4850        echo $args['before_widget'];
     51
    4952        if ( $title ) {
    5053            echo $args['before_title'] . $title . $args['after_title'];
     
    7679            </ul>
    7780            <?php
     81
    7882        echo $args['after_widget'];
    7983    }
Note: See TracChangeset for help on using the changeset viewer.