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-tag-cloud.php

    r41685 r41867  
    4040     */
    4141    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'] ) ) {
    4445            $title = $instance['title'];
    4546        } else {
    46             if ( 'post_tag' == $current_taxonomy ) {
    47                 $title = __('Tags');
     47            if ( 'post_tag' === $current_taxonomy ) {
     48                $title = __( 'Tags' );
    4849            } else {
    49                 $tax = get_taxonomy($current_taxonomy);
     50                $tax = get_taxonomy( $current_taxonomy );
    5051                $title = $tax->labels->name;
    5152            }
Note: See TracChangeset for help on using the changeset viewer.