0 ) { // recursive case: call retrieve_recipients on each $item // merge the results and return them foreach ( $items as $item ) { // TODO what will $item look like? Could be an actor JSON, or just a URL? $recipients[] = retrieve_recipients( $item ); } } return $recipients; default: // an actor if ( array_key_exists( 'inbox', $response_body ) ) { return array( $response_body['inbox'] ); } return array(); } } function post_activity_to_inboxes( $activity, $recipients ) { foreach ( $inbox as $recipients ) { // TODO wp_remote_post(); } } ?>