WordPress.org

Ready to get started?Download WordPress

Forums

Woo Recent Posts
Empty Widget Titles should be allowed (1 post)

  1. helgatheviking
    Member
    Posted 11 months ago #

    If I don't want a widget title I ought to be able to save an empty value and have the widget title not display. from the widget() method:

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

    Your code is forcing the title to be "Recent Posts" even if I don't want a title. I think a better alternative would be to conditionally display the title if it exists:

    $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;

    and have "Recent Posts" as the suggested default in the form() method of the widget.

    http://wordpress.org/extend/plugins/woo-recent-posts/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 11 months ago by helgatheviking
  • This topic is not resolved
  • WordPress version: 3.5.1