BP_Document::get_activity_attachment_id( integer $activity_id )

Get document attachment id for the activity.

Description

Parameters

$activity_id

(Required) Activity ID

Return

(integer|bool)

Source

File: bp-document/classes/class-bp-document.php

2350
2351
2352
2353
2354
2355
2356
2357
2358
public static function get_activity_attachment_id( $activity_id = 0 ) {
    global $bp, $wpdb;
 
    if ( empty( $activity_id ) ) {
        return false;
    }
 
    return (int) $wpdb->get_var( "SELECT DISTINCT d.attachment_id FROM {$bp->document->table_name} d WHERE d.activity_id = {$activity_id}" );
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.