BP_Media_Album::album_exists( string $id )

Get whether an album exists for a given id.

Description

Parameters

$id

(Required) ID to check.

$type

(Required) type to check.

Return

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

Source

File: bp-media/classes/class-bp-media-album.php

563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
public static function album_exists( $id ) {
    if ( empty( $id ) ) {
        return false;
    }
 
    $args = array(
        'in' => $id,
    );
 
    $albums = BP_Media_Album::get( $args );
 
    $album_id = false;
    if ( ! empty( $albums['albums'] ) ) {
        $album_id = current( $albums['albums'] )->id;
    }
 
    return $album_id;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.