Skip to:
Content

BuddyPress.org

Ticket #6222: 6222.02.patch

File 6222.02.patch, 2.9 KB (added by dcavins, 11 years ago)

Verify that title is set before widget_title filter. Use calculated value in filter. Be sure that the title value is set before passing to the filter. See #6222.

  • src/bp-blogs/bp-blogs-widgets.php

    diff --git src/bp-blogs/bp-blogs-widgets.php src/bp-blogs/bp-blogs-widgets.php
    index cae2508..5cb224f 100644
    class BP_Blogs_Recent_Posts_Widget extends WP_Widget { 
    6666                 * @param array  $instance The settings for the particular instance of the widget.
    6767                 * @param string $id_base  Root ID for all widgets of this type.
    6868                 */
    69                 $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
     69                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    7070
    7171                echo $args['before_widget'];
    7272                echo $args['before_title'] . $title . $args['after_title'];
  • src/bp-core/bp-core-widgets.php

    diff --git src/bp-core/bp-core-widgets.php src/bp-core/bp-core-widgets.php
    index 05c88ba..48a29e2 100644
    class BP_Core_Login_Widget extends WP_Widget { 
    6161                 * @param array  $instance The settings for the particular instance of the widget.
    6262                 * @param string $id_base  Root ID for all widgets of this type.
    6363                 */
    64                 $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
     64                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    6565
    6666                echo $args['before_widget'];
    6767
  • src/bp-members/bp-members-widgets.php

    diff --git src/bp-members/bp-members-widgets.php src/bp-members/bp-members-widgets.php
    index c3f8993..cb21eb9 100644
    class BP_Core_Members_Widget extends WP_Widget { 
    5959                if ( !$instance['member_default'] )
    6060                        $instance['member_default'] = 'active';
    6161
     62                if ( empty( $instance['title'] ) ) {
     63                        $instance['title'] = '';
     64                }
     65
    6266                /**
    6367                 * Filters the title of the Members widget.
    6468                 *
    class BP_Core_Whos_Online_Widget extends WP_Widget { 
    231235
    232236                extract( $args );
    233237
     238                if ( empty( $instance['title'] ) ) {
     239                        $instance['title'] = '';
     240                }
     241
    234242                /**
    235243                 * Filters the title of the Who's Online widget.
    236244                 *
    class BP_Core_Recently_Active_Widget extends WP_Widget { 
    347355
    348356                extract( $args );
    349357
     358                if ( empty( $instance['title'] ) ) {
     359                        $instance['title'] = '';
     360                }
     361
    350362                /**
    351363                 * Filters the title of the Recently Active widget.
    352364                 *
  • src/bp-messages/bp-messages-widgets.php

    diff --git src/bp-messages/bp-messages-widgets.php src/bp-messages/bp-messages-widgets.php
    index 606efa2..7c8ddd8 100644
    class BP_Messages_Sitewide_Notices_Widget extends WP_Widget { 
    7373                 * @param array  $instance The settings for the particular instance of the widget.
    7474                 * @param string $id_base  Root ID for all widgets of this type.
    7575                 */
    76                 $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
     76                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    7777
    7878                echo $before_widget;
    7979                echo $before_title . $title . $after_title; ?>