Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress Activity posts


  • goku22
    Participant

    @goku22

    In my functions.php I have added following lines of code but nothing is happening. I want that when I open my activity page a post get submitted automatically:
    function record_activity_grocery_task(){

    $activity_id = bp_activity_add(array(
    ‘id’ => false,
    ‘user_id’ => bp_loggedin_user_id(),
    ‘item_id’ => false,
    ‘action’ => ‘Posted a new photo’, // The activity action – e.g. “Jon Doe posted an update”.
    ‘content’ => ‘Grocery task form submitted’,
    ‘component’ => false, // The name/ID of the component e.g. groups, profile, mycomponent.
    ‘primary_link’ => ”, // Optional: The primary URL for this item in RSS feeds (defaults to activity)
    ‘type’ => ‘activity_update’, // The activity type e.g. activity_update, profile_updated.
    ‘item_id’ => false,
    ‘secondary_item_id’ => false,
    ‘recorded_time’ => bp_core_current_time(),
    ‘hide_sitewide’ => false,
    ‘is_spam’ => false,
    ‘error_type’ => ‘bool’
    ));

    }

    add_action(‘bp_init’,’record_activity_grocery_task’);

  • You must be logged in to reply to this topic.
Skip to toolbar