Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/13/2014 07:05:27 PM (13 years ago)
Author:
boonebgorges
Message:

Use WP Plugin API rather than call_user_func() to apply format_callback to activity actions

This allows plugin authors to modify or override default formatting callbacks
using the standard remove_filter() and add_filter() API functions.

Hat-tip to nacin for the idea

See #3856

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-activity.php

    r8125 r8126  
    4848 * @since BuddyPress (2.0.0)
    4949 *
     50 * @param string $action Static activity action.
    5051 * @param object $activity Activity object.
    5152 * @return string
    5253 */
    53 function bp_xprofile_format_activity_action_new_avatar( $activity ) {
     54function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) {
    5455        $userlink = bp_core_get_userlink( $activity->user_id );
    5556        $action   = sprintf( __( '%s changed their profile picture', 'buddypress' ), $userlink );
    … …  
    6869 * @since BuddyPress (2.0.0)
    6970 *
     71 * @param string $action Static activity action.
    7072 * @param object $activity Activity object.
    7173 * @return string
    7274 */
    73 function bp_xprofile_format_activity_action_new_member( $activity ) {
     75function bp_xprofile_format_activity_action_new_member( $action, $activity ) {
    7476        $userlink = bp_core_get_userlink( $activity->user_id );
    7577        $action   = sprintf( __( '%s became a registered member', 'buddypress' ), $userlink );
    … …  
    8890 * @since BuddyPress (2.0.0)
    8991 *
     92 * @param string $action Static activity action.
    9093 * @param object $activity Activity object.
    9194 * @return string
    9295 */
    93 function bp_xprofile_format_activity_action_updated_profile( $activity ) {
     96function bp_xprofile_format_activity_action_updated_profile( $action, $activity ) {
    9497        // Note for translators: The natural phrasing in English, "Joe updated
    9598        // his profile", requires that we know Joe's gender, which we don't. If
Note: See TracChangeset for help on using the changeset viewer.