BP_Document_Folder::folder_exists( string $id )

Get whether an folder exists for a given id.

Description

Parameters

$id

(string) (Required) ID to check.

Return

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

Source

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

	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.