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 ) { $args = array( 'body' => $activity, 'headers' => array( 'Content-Type' => 'application/ld+json' ) ); // TODO do something with the result? wp_remote_post( $inbox, $args ); } } ?>