Skip to:
Content

BuddyPress.org

Changeset 1749 for trunk/bp-activity.php


Ignore:
Timestamp:
09/01/2009 01:45:37 AM (17 years ago)
Author:
apeatling
Message:

Centrally registered activity actions in $bp->activity->actions. This will be used to add privacy support to activity feeds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r1733 r1749  
    6060        $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity_user_activity_cached';
    6161        $bp->activity->slug = BP_ACTIVITY_SLUG;
    62        
     62               
    6363        /* Register this in the active components array */
    6464        $bp->active_components[$bp->activity->slug] = $bp->activity->id;
     
    330330}
    331331
     332function bp_activity_set_action( $component_id, $key, $value ) {
     333        global $bp;
     334       
     335        if ( empty( $component_id ) || empty( $key ) || empty( $value ) )
     336                return false;
     337       
     338        $bp->activity->actions->{$component_id}->{$key} = apply_filters( 'bp_activity_set_action', array(
     339                'key' => $key,
     340                'value' => $value
     341        ), $component_id, $key, $value );
     342}
     343
     344function bp_activity_get_action( $component_id, $key ) {
     345        global $bp;
     346       
     347        if ( empty( $component_id ) || empty( $key ) )
     348                return false;
     349       
     350        return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key );
     351}
     352
     353function groups_get_activity_action( $key ) {
     354        if ( !function_exists( 'bp_activity_get_action' ) )
     355                return false;
     356       
     357        return apply_filters( 'groups_get_activity_action', bp_activity_get_action( $key ), $key );
     358}
     359
    332360function bp_activity_get_last_updated() {
    333361        return BP_Activity_Activity::get_last_updated();
Note: See TracChangeset for help on using the changeset viewer.