Skip to:
Content

BuddyPress.org

Changeset 1749 for trunk/bp-status.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-status.php

    r1723 r1749  
    1212    $bp->status->id = 'status';
    1313    $bp->status->slug = BP_STATUS_SLUG;
     14   
     15    /* Register the activity stream actions for this component */
     16    bp_status_register_activity_action( 'new_status', __( 'New status update', 'buddypress' ) );
    1417
    1518    /* Register this in the active components array */
     
    1922add_action( 'admin_menu', 'bp_status_setup_globals', 2 );
    2023
    21 function bp_status_record_activity( $user_id, $content, $primary_link ) {
     24
     25/********************************************************************************
     26 * Activity & Notification Functions
     27 *
     28 * These functions handle the recording, deleting and formatting of activity and
     29 * notifications for the user and for this specific component.
     30 */
     31
     32function bp_status_record_activity( $user_id, $content, $primary_link, $component_action = 'new_status' ) {
    2233    if ( !function_exists( 'bp_activity_add' ) )
    2334        return false;
     
    2839            'primary_link' => $primary_link,
    2940            'component_name' => 'status',
    30             'component_action' => 'new_status'
     41            'component_action' => $component_action
    3142           ) );
    3243}
     
    5566   
    5667    return apply_filters( 'bp_status_format_activity', $stream_item, $user_id, $content, $component_action );
     68}
     69
     70function bp_status_register_activity_action( $key, $value ) {
     71    global $bp;
     72   
     73    if ( !function_exists( 'bp_activity_set_action' ) )
     74        return false;
     75   
     76    return apply_filters( 'bp_status_register_activity_action', bp_activity_set_action( $bp->status->id, $key, $value ), $key, $value );
    5777}
    5878
Note: See TracChangeset for help on using the changeset viewer.