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
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
| 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.