• Currently if I do not enter a widget title I am forced to use “Recent Posts”

    from the widget() method:

    $title = apply_filters( 'widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);

    However, I think it makes more sense if the widget title is suggested as the default in the form() method and then optionally displayed if it exists in the widget() method:

    $title = apply_filters( 'widget_title', isset($instance['title']) ? $instance['title'] : '', $instance, $this->id_base);
            $widget_output_template = (empty($instance['widget_output_template'])) ? $this->default_config['widget_output_template'] : $instance['widget_output_template'];
    
            if( $title ) echo $before_title . $title . $after_title;

The topic ‘Allow empty titles’ is closed to new replies.