Skip to:
Content

BuddyPress.org

Changeset 6999


Ignore:
Timestamp:
05/06/2013 12:01:25 AM (12 years ago)
Author:
boonebgorges
Message:

Put widget titles through WP's widget_title filter before assembling markup

This will provide a more predictable way to modify widget titles in the same
way as WP's core widgets.

Fixes #4299

Props magnus78, merty

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-widgets.php

    r6432 r6999  
    2929
    3030        extract( $args );
     31
     32        $widget_name = apply_filters( 'widget_title', $widget_name );
    3133
    3234        echo $before_widget;
  • trunk/bp-core/bp-core-widgets.php

    r6975 r6999  
    3535            $instance['member_default'] = 'active';
    3636
     37        $title = apply_filters( 'widget_title', $instance['title'] );
     38
    3739        echo $before_widget;
    3840
    39         $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
     41        $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . $title . '</a>' : $title;
    4042
    4143        echo $before_title
     
    156158    function widget($args, $instance) {
    157159
    158         extract( $args );
     160        extract( $args );
     161
     162        $title = apply_filters( 'widget_title', $instance['title'] );
    159163
    160164        echo $before_widget;
    161165        echo $before_title
    162            . $instance['title']
     166           . $title
    163167           . $after_title; ?>
    164168
     
    225229        extract( $args );
    226230
     231        $title = apply_filters( 'widget_title', $instance['title'] );
     232
    227233        echo $before_widget;
    228234        echo $before_title
    229            . $instance['title']
     235           . $title
    230236           . $after_title; ?>
    231237
  • trunk/bp-groups/bp-groups-widgets.php

    r6975 r6999  
    4848            $instance['title'] = __( 'Groups', 'buddypress' );
    4949
     50        $title = apply_filters( 'widget_title', $instance['title'] );
     51
    5052        echo $before_widget;
    5153
    52         $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title'];
     54        $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $title . '</a>' : $title;
    5355
    5456        echo $before_title . $title . $after_title; ?>
Note: See TracChangeset for help on using the changeset viewer.