Abstract_Account_Api::get_list_of_accounts( boolean $all_data = false )
Get the listing of Accounts.
Contents
Parameters
- $all_data
-
(boolean) (Optional) Whether to return all account data, default is only name and status.
Default value: false
Return
(TribeEventsVirtualIntegrationsarray<string|TribeEventsVirtualIntegrationsstring>) $list_of_accounts An array of all the accounts.
Source
File: src/Tribe/Integrations/Abstract_Account_Api.php
public function get_list_of_accounts( $all_data = false ) {
$list_of_accounts = get_option( $this->all_account_key, [] );
foreach ( $list_of_accounts as $account_id => $account ) {
if ( empty( $account['name'] ) ) {
continue;
}
$list_of_accounts[ $account_id ]['name'] = $account['name'];
// If false (default ) skip getting all the account data.
if ( empty( $all_data ) ) {
continue;
}
$account_data = $this->get_account_by_id( $account_id );
$list_of_accounts[ $account_id ] = $account_data;
}
return $list_of_accounts;
}
Changelog
| Version | Description |
|---|---|
| 1.9.0 | Introduced. |