function twitter_twitter_accounts in Twitter 7.5
Same name and namespace in other branches
- 6.5 twitter.module \twitter_twitter_accounts()
- 6.2 twitter.module \twitter_twitter_accounts()
- 6.3 twitter.module \twitter_twitter_accounts()
- 6.4 twitter.module \twitter_twitter_accounts()
- 7.6 twitter.module \twitter_twitter_accounts()
- 7.3 twitter.module \twitter_twitter_accounts()
- 7.4 twitter.module \twitter_twitter_accounts()
Implements hook_twitter_accounts().
Return value
array All Twitter accounts for this user; the anonymous user will return an empty array.
1 call to twitter_twitter_accounts()
- twitter_user_settings in ./
twitter.pages.inc - Form builder that lists Twitter accounts.
File
- ./
twitter.module, line 545 - Provides API integration with the Twitter microblogging service.
Code
function twitter_twitter_accounts($account) {
if ($account->uid == 0) {
return array();
}
module_load_include('inc', 'twitter');
$query = db_select('twitter_account', 'ta')
->fields('ta', array(
'twitter_uid',
))
->condition('ta.uid', $account->uid);
$twitter_accounts = array();
foreach ($query
->execute()
->fetchCol() as $twitter_uid) {
$twitter_accounts[] = twitter_account_load($twitter_uid);
}
return $twitter_accounts;
}