Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

  • astrologeeks
    Participant

    @astrologeeks

    Then in your entry.php file in your custom buddypress theme folder (located in wp-content/themes/your-theme/buddypress/activity/), replace the delete link code from this

    <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>

    to this

    <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link_aside(); ?>


    astrologeeks
    Participant

    @astrologeeks

    You will need to add something like this to your bp-custom.php file. If you haven’t already, create this file and place it in the wp-content/plugins/ folder. I added “aside” to the name to tell buddypress this is a custom function and not re-declare an already existing function.

    function bp_get_activity_delete_link_aside() { 
     
        $url = bp_get_activity_delete_url(); 
        $class = 'delete-activity'; 
     
        // Determine if we're on a single activity page, and customize accordingly. 
        if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { 
            $class = 'delete-activity-single'; 
        } 
     
        $link = '<a href="' . esc_url( $url ) . '" class="item-button bp-secondary-action ' . $class . ' confirm btn white btn-xs" rel="nofollow" style="padding: .2195rem .5rem;font-size: 0.8rem;">' . __( '<i class="fa fa-fw fa-trash text-muted"></i>', 'buddypress' ) . '</a>'; 
     
        /** 
         * Filters the activity delete link. 
         * 
         * @since 1.1.0 
         * 
         * @param string $link Activity delete HTML link. 
         */ 
        return apply_filters( 'bp_get_activity_delete_link', $link ); 
    } 
    function bp_activity_delete_link_aside() { 
        echo bp_get_activity_delete_link_aside(); 
    } 
Viewing 2 replies - 1 through 2 (of 2 total)
Skip to toolbar