| @@ 302-313 (lines=12) @@ | ||
| 299 | 'tumblr' => array(), |
|
| 300 | ); |
|
| 301 | ||
| 302 | if ( 'all' == $filter ) { |
|
| 303 | return $services; |
|
| 304 | } else { |
|
| 305 | $connected_services = array(); |
|
| 306 | foreach ( $services as $service_name => $empty ) { |
|
| 307 | $connections = $this->get_connections( $service_name, $_blog_id, $_user_id ); |
|
| 308 | if ( $connections ) { |
|
| 309 | $connected_services[ $service_name ] = $connections; |
|
| 310 | } |
|
| 311 | } |
|
| 312 | return $connected_services; |
|
| 313 | } |
|
| 314 | } |
|
| 315 | ||
| 316 | function get_connection( $service_name, $id, $_blog_id = false, $_user_id = false ) { |
|
| @@ 69-80 (lines=12) @@ | ||
| 66 | function get_services( $filter = 'all' ) { |
|
| 67 | $services = array(); |
|
| 68 | ||
| 69 | if ( 'all' === $filter ) { |
|
| 70 | return $services; |
|
| 71 | } else { |
|
| 72 | $connected_services = array(); |
|
| 73 | foreach ( $services as $service => $empty ) { |
|
| 74 | $connections = $this->get_connections( $service ); |
|
| 75 | if ( $connections ) { |
|
| 76 | $connected_services[ $service ] = $connections; |
|
| 77 | } |
|
| 78 | } |
|
| 79 | return $connected_services; |
|
| 80 | } |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|