Account_API::get_formatted_account_list( $active_only = false )
Get list of accounts formatted for options dropdown.
Contents
Parameters
- $all_data
-
(boolean) (Required) Whether to return only active accounts or not.
Return
(TribeEventsVirtualMeetingsZoomarray<string,mixed>) An array of Zoom Accounts formatted for options dropdown.
Source
File: src/Tribe/Meetings/Zoom/Account_API.php
public function get_formatted_account_list( $active_only = false ) {
$available_accounts = $this->get_list_of_accounts( true );
if ( empty( $available_accounts ) ) {
return [];
}
$accounts = [];
foreach ( $available_accounts as $account ) {
$name = Arr::get( $account, 'name', '' );
$value = Arr::get( $account, 'id', '' );
$status = Arr::get( $account, 'status', false );
if ( empty( $name ) || empty( $value ) ) {
continue;
}
if ( $active_only && ! $status ) {
continue;
}
$accounts[] = [
'text' => (string) $name,
'id' => (string) $value,
'value' => (string) $value,
];
}
return $accounts;
}
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |