BP_Document_Folder::folder_exists( string $id )

Get whether an folder exists for a given id.

Description

Parameters

$id

(Required) ID to check.

Return

(int|bool) Folder ID if found; false if not.

Source

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

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
public static function folder_exists( $id ) {
    if ( empty( $id ) ) {
        return false;
    }
 
    $args = array(
        'in'     => $id,
        'fields'  => 'ids'
    );
 
    $folders = self::get( $args );
 
    $folder_id = false;
    if ( ! empty( $folders['folders'] ) ) {
        $folder_id = current( $folders['folders'] );
    }
 
    return $folder_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.