Skip to:
Content

BuddyPress.org

Changes between Version 3 and Version 4 of Ticket #6569, comment 17


Ignore:
Timestamp:
08/06/2015 10:03:18 PM (4 years ago)
Author:
modemlooper
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6569, comment 17

    v3 v4  
    77I propose we pass back the activity object , then we can get the ID and run any meta functions.
    88
    9 ```do_action( 'bp_activity_add', $r, $activity );```
     9
     10{{{
     11do_action( 'bp_activity_add', $r, $activity );
     12}}}
     13
    1014
    1115then we can do an easy hook to add the meta or process it however needed.
    1216
    13 ```function try_add_meta( $r, $activity ) {
     17
     18{{{
     19function try_add_meta( $r, $activity ) {
    1420
    1521        bp_activity_update_meta( $activity->ID, 'key', $r['meta'] );
    1622       
    1723}
    18 add_action( 'bp_activity_add', 'try_add_meta', 10, 2 );```
     24add_action( 'bp_activity_add', 'try_add_meta', 10, 2 );
     25}}}