Skip to:
Content
Pages
Categories
Search
Top
Bottom

please help~~ something about bp_activity_deleted_activities action

  • @tatterslee

    Member

    hi,dear all, could you please help me..(sorry for my poor english , i am a chinese people.)

    the problem is :

    I rewrite a favorite funcion: if I favorite an activity, then send a new activity that the item_id is the original activity’s ID.
    for example?an activity id is 1?then I favorite it?then send a new activity that the ID maybe is 2?item_id still is 1.

    I have made it work correctly.

    but if I delete the activity that ID is 2?I want to use the function “bp_activity_remove_user_favorite()” to remove the activity id of 1 from “bp_favorite_activities” in wp_usermeta table?

    So I write a function:

    function my_function() {
    global $bp, $activities_template;
    $item_id = bp_get_activity_item_id();
    bp_activity_remove_user_favorite($item_id);
    }
    add_action( ‘bp_activity_deleted_activities’, ‘my_function’ );

    but it doesn’t work. if i make $item_id = ‘1’;,the it works.
    so, i’m afraid that “$item_id = bp_get_activity_item_id()” has something wrong.

    Would you please help me about this? Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘please help~~ something about bp_activity_deleted_activities action’ is closed to new replies.
Skip to toolbar