Skip to:
Content

BuddyPress.org

Ticket #6222: 6222.01.patch

File 6222.01.patch, 6.7 KB (added by dcavins, 11 years ago)

Add arguments to 'widget_title' filter. Add $instance settings and $id_base to the arguments passed along with the ‘widget_title’ filter for BP core widgets.

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

    diff --git src/bp-blogs/bp-blogs-widgets.php src/bp-blogs/bp-blogs-widgets.php
    index 8a8f590..cae2508 100644
    class BP_Blogs_Recent_Posts_Widget extends WP_Widget { 
    6060                 * Filters the Blogs Recent Posts widget title.
    6161                 *
    6262                 * @since BuddyPress (2.2.0)
     63                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    6364                 *
    64                  * @param string $title The widget title.
     65                 * @param string $title    The widget title.
     66                 * @param array  $instance The settings for the particular instance of the widget.
     67                 * @param string $id_base  Root ID for all widgets of this type.
    6568                 */
    66                 $title = apply_filters( 'widget_title', $instance['title'] );
     69                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    6770
    6871                echo $args['before_widget'];
    6972                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 8ea3375..05c88ba 100644
    class BP_Core_Login_Widget extends WP_Widget { 
    5555                 * Filters the title of the Login widget.
    5656                 *
    5757                 * @since BuddyPress (1.9.0)
     58                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    5859                 *
    59                  * @param string $title The widget title.
     60                 * @param string $title    The widget title.
     61                 * @param array  $instance The settings for the particular instance of the widget.
     62                 * @param string $id_base  Root ID for all widgets of this type.
    6063                 */
    61                 $title = apply_filters( 'widget_title', $title );
     64                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    6265
    6366                echo $args['before_widget'];
    6467
  • src/bp-friends/bp-friends-widgets.php

    diff --git src/bp-friends/bp-friends-widgets.php src/bp-friends/bp-friends-widgets.php
    index 831b005..ad4205d 100644
    class BP_Core_Friends_Widget extends WP_Widget { 
    8080                 * Filters the Friends widget title.
    8181                 *
    8282                 * @since BuddyPress (1.8.0)
     83                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    8384                 *
    84                  * @param string $title The widget title.
     85                 * @param string $title    The widget title.
     86                 * @param array  $instance The settings for the particular instance of the widget.
     87                 * @param string $id_base  Root ID for all widgets of this type.
    8588                 */
    86                 $title = apply_filters( 'widget_title', $instance['title'] );
     89                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    8790
    8891                echo $before_widget;
    8992
  • src/bp-groups/bp-groups-widgets.php

    diff --git src/bp-groups/bp-groups-widgets.php src/bp-groups/bp-groups-widgets.php
    index 808ee02..2117aed 100644
    class BP_Groups_Widget extends WP_Widget { 
    6464                 * Filters the title of the Groups widget.
    6565                 *
    6666                 * @since BuddyPress (1.8.0)
     67                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    6768                 *
    68                  * @param string $value The widget title.
     69                 * @param string $title    The widget title.
     70                 * @param array  $instance The settings for the particular instance of the widget.
     71                 * @param string $id_base  Root ID for all widgets of this type.
    6972                 */
    70                 $title = apply_filters( 'widget_title', $instance['title'] );
     73                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    7174
    7275                echo $before_widget;
    7376
  • src/bp-members/bp-members-widgets.php

    diff --git src/bp-members/bp-members-widgets.php src/bp-members/bp-members-widgets.php
    index ba010f6..c3f8993 100644
    class BP_Core_Members_Widget extends WP_Widget { 
    6363                 * Filters the title of the Members widget.
    6464                 *
    6565                 * @since BuddyPress (1.8.0)
     66                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    6667                 *
    67                  * @param string $value The widget title.
     68                 * @param string $title    The widget title.
     69                 * @param array  $instance The settings for the particular instance of the widget.
     70                 * @param string $id_base  Root ID for all widgets of this type.
    6871                 */
    69                 $title = apply_filters( 'widget_title', $instance['title'] );
     72                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    7073
    7174                echo $before_widget;
    7275
    class BP_Core_Whos_Online_Widget extends WP_Widget { 
    232235                 * Filters the title of the Who's Online widget.
    233236                 *
    234237                 * @since BuddyPress (1.8.0)
     238                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    235239                 *
    236                  * @param string $value The widget title.
     240                 * @param string $title    The widget title.
     241                 * @param array  $instance The settings for the particular instance of the widget.
     242                 * @param string $id_base  Root ID for all widgets of this type.
    237243                 */
    238                 $title = apply_filters( 'widget_title', $instance['title'] );
     244                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    239245
    240246                echo $before_widget;
    241247                echo $before_title
    class BP_Core_Recently_Active_Widget extends WP_Widget { 
    345351                 * Filters the title of the Recently Active widget.
    346352                 *
    347353                 * @since BuddyPress (1.8.0)
     354                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    348355                 *
    349                  * @param string $value The widget title.
     356                 * @param string $title    The widget title.
     357                 * @param array  $instance The settings for the particular instance of the widget.
     358                 * @param string $id_base  Root ID for all widgets of this type.
    350359                 */
    351                 $title = apply_filters( 'widget_title', $instance['title'] );
     360                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    352361
    353362                echo $before_widget;
    354363                echo $before_title
  • src/bp-messages/bp-messages-widgets.php

    diff --git src/bp-messages/bp-messages-widgets.php src/bp-messages/bp-messages-widgets.php
    index 9ca3d18..606efa2 100644
    class BP_Messages_Sitewide_Notices_Widget extends WP_Widget { 
    6767                 * Filters the title of the Messages widget.
    6868                 *
    6969                 * @since BuddyPress (1.9.0)
     70                 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    7071                 *
    71                  * @param string $title The widget title.
     72                 * @param string $title    The widget title.
     73                 * @param array  $instance The settings for the particular instance of the widget.
     74                 * @param string $id_base  Root ID for all widgets of this type.
    7275                 */
    73                 $title = apply_filters( 'widget_title', $title, $instance );
     76                $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
    7477
    7578                echo $before_widget;
    7679                echo $before_title . $title . $after_title; ?>