Skip to:
Content

BuddyPress.org

Changeset 4553


Ignore:
Timestamp:
06/22/2011 11:40:13 AM (13 years ago)
Author:
boonebgorges
Message:

Pass activity object to bp_activity_get_permalink filter. Fixes #3296. Props r-a-y

File:
1 edited

Legend:

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

    r4378 r4553  
    6868            if ( !$new_mentions = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ), true ) )
    6969                $new_mentions = array();
    70                
     70
    7171            switch ( $action ) {
    7272                case 'delete' :
     
    7676                    }
    7777                    break;
    78                
     78
    7979                case 'add' :
    8080                default :
     
    8484                    break;
    8585            }
    86            
    87             // Get an updated mention count         
     86
     87            // Get an updated mention count
    8888            $new_mention_count = count( $new_mentions );
    89            
     89
    9090            // Resave the user_meta
    9191            update_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ), $new_mention_count );
     
    876876    }
    877877
     878/**
     879 * Get the permalink for a single activity item
     880 *
     881 * When only the $activity_id param is passed, BP has to instantiate a new BP_Activity_Activity
     882 * object. To save yourself some processing overhead, be sure to pass the full $activity_obj param
     883 * as well, if you already have it available.
     884 *
     885 * @package BuddyPress
     886 *
     887 * @uses apply_filters_ref_array() Filter 'bp_activity_get_permalink' to modify the function output
     888 * @param int $activity_id The unique id of the activity object
     889 * @param obj $activity_obj (optional) The activity object
     890 * @return str $link Permalink for the activity item
     891 */
    878892function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
    879893    global $bp;
     
    891905    }
    892906
    893     return apply_filters( 'bp_activity_get_permalink', $link );
     907    return apply_filters_ref_array( 'bp_activity_get_permalink', array( $link, &$activity_obj ) );
    894908}
    895909
Note: See TracChangeset for help on using the changeset viewer.