Making WordPress.org


Ignore:
Timestamp:
01/18/2019 01:20:51 AM (6 years ago)
Author:
coreymckrill
Message:

WordCamp Post Types: Ensure widgets don't have undefined title index

This eliminates an error that was thrown while trying to render any of the
custom WordCamp Post Type widgets, in the case that the widget did not have
a title value defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/inc/widgets.php

    r6764 r8094  
    2323
    2424        extract( $args );
    25         $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
     25        $title = ( isset( $instance['title'] ) ) ?: '';
     26        $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    2627
    2728        echo $before_widget;
     
    129130
    130131        $transient_key     = 'wcpt-' . md5( $args['widget_id'] );
     132        $instance['title'] = ( isset( $instance['title'] ) ) ?: '';
    131133        $instance['title'] = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    132134
     
    243245
    244246        $transient_key     = 'wcpt-' . md5( $args['widget_id'] );
     247        $instance['title'] = ( isset( $instance['title'] ) ) ?: '';
    245248        $instance['title'] = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    246249
     
    361364
    362365        $transient_key     = 'wcpt-' . md5( $args['widget_id'] );
     366        $instance['title'] = ( isset( $instance['title'] ) ) ?: '';
    363367        $instance['title'] = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    364368
Note: See TracChangeset for help on using the changeset viewer.