| @@ 50-61 (lines=12) @@ | ||
| 47 | ||
| 48 | ); |
|
| 49 | ||
| 50 | if ( 'all' == $filter ) { |
|
| 51 | return $services; |
|
| 52 | } else { |
|
| 53 | $connected_services = array(); |
|
| 54 | foreach ( $services as $service => $empty ) { |
|
| 55 | $connections = $this->get_connections( $service ); |
|
| 56 | if ( $connections ) { |
|
| 57 | $connected_services[ $service ] = $connections; |
|
| 58 | } |
|
| 59 | } |
|
| 60 | return $connected_services; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| @@ 304-315 (lines=12) @@ | ||
| 301 | 'google_plus' => array(), |
|
| 302 | ); |
|
| 303 | ||
| 304 | if ( 'all' == $filter ) { |
|
| 305 | return $services; |
|
| 306 | } else { |
|
| 307 | $connected_services = array(); |
|
| 308 | foreach ( $services as $service_name => $empty ) { |
|
| 309 | $connections = $this->get_connections( $service_name, $_blog_id, $_user_id ); |
|
| 310 | if ( $connections ) { |
|
| 311 | $connected_services[ $service_name ] = $connections; |
|
| 312 | } |
|
| 313 | } |
|
| 314 | return $connected_services; |
|
| 315 | } |
|
| 316 | } |
|
| 317 | ||
| 318 | function get_connection( $service_name, $id, $_blog_id = false, $_user_id = false ) { |
|