Skip to:
Content

BuddyPress.org

Ticket #6890: 6890.diff

File 6890.diff, 3.2 KB (added by umesh.nevase, 7 years ago)

I've replaced deprecated bp_activity_delete_by_item_id with bp_activity_delete. I've tested on my side, needs more testing.

  • src/bp-activity/bp-activity-functions.php

    diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
    index 7059500..eaf3fe5 100644
    function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { 
    22022202                'user_id'           => false,
    22032203        );
    22042204
    2205         $deleted = bp_activity_delete_by_item_id( $delete_activity_args );
     2205        $deleted = bp_activity_delete( $r );
    22062206
    22072207        /**
    22082208         * Fires after the unpublishing for the custom post type.
    function bp_activity_post_type_remove_comment( $comment_id = 0, $activity_post_o 
    24502450        $deleted = false;
    24512451
    24522452        if ( bp_disable_blogforum_comments() ) {
    2453                 $deleted = bp_activity_delete_by_item_id( array(
     2453                $r = array(
    24542454                        'item_id'           => get_current_blog_id(),
    24552455                        'secondary_item_id' => $comment_id,
    24562456                        'component'         => $activity_comment_object->component_id,
    24572457                        'type'              => $activity_comment_object->action_id,
    24582458                        'user_id'           => false,
    2459                 ) );
     2459                );
     2460                $deleted = bp_activity_delete( $r );
    24602461        }
    24612462
    24622463        /**
  • src/bp-blogs/bp-blogs-activity.php

    diff --git src/bp-blogs/bp-blogs-activity.php src/bp-blogs/bp-blogs-activity.php
    index cf7b60a..bff1f72 100644
    function bp_blogs_delete_activity( $args = '' ) { 
    515515                'secondary_item_id' => false
    516516        ) );
    517517
    518         bp_activity_delete_by_item_id( $r );
     518        bp_activity_delete( $r );
    519519}
    520520
    521521/**
  • src/bp-friends/bp-friends-activity.php

    diff --git src/bp-friends/bp-friends-activity.php src/bp-friends/bp-friends-activity.php
    index b9508c1..1abbd7f 100644
    function friends_delete_activity( $args ) { 
    7575        if ( ! bp_is_active( 'activity' ) ) {
    7676                return;
    7777        }
    78 
    79         bp_activity_delete_by_item_id( array(
     78        $r  = bp_parse_args( $args, array(
    8079                'component' => buddypress()->friends->id,
    81                 'item_id'   => $args['item_id'],
    82                 'type'      => $args['type'],
    83                 'user_id'   => $args['user_id']
     80                'item_id'   => false,
     81                'type'      => false,
     82                'user_id'   => false
    8483        ) );
     84        bp_activity_delete( $r );
    8585}
    8686
    8787/**
  • src/bp-groups/bp-groups-activity.php

    diff --git src/bp-groups/bp-groups-activity.php src/bp-groups/bp-groups-activity.php
    index d75494c..0d869c3 100644
    add_action( 'groups_details_updated', 'bp_groups_group_details_updated_add_activ 
    525525 */
    526526function bp_groups_delete_group_delete_all_activity( $group_id ) {
    527527        if ( bp_is_active( 'activity' ) ) {
    528                 bp_activity_delete_by_item_id( array(
     528                $r = array(
    529529                        'item_id'   => $group_id,
    530                         'component' => buddypress()->groups->id
    531                 ) );
     530                        'component' => buddypress()->groups->id,
     531                        );
     532                bp_activity_delete( $r );
    532533        }
    533534}
    534535add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_activity', 10 );
  • src/bp-xprofile/bp-xprofile-activity.php

    diff --git src/bp-xprofile/bp-xprofile-activity.php src/bp-xprofile/bp-xprofile-activity.php
    index 738ad0a..2792444 100644
    function xprofile_delete_activity( $args = '' ) { 
    164164        ), 'xprofile_delete_activity' );
    165165
    166166        // Delete the activity item.
    167         bp_activity_delete_by_item_id( $r );
     167        bp_activity_delete( $r );
    168168}
    169169
    170170/**