From dca93a770a03ad3bccdabdfa0550e2a7cdcb58d0 Mon Sep 17 00:00:00 2001 From: Yann Kozon Date: Thu, 10 Dec 2020 17:45:03 +0100 Subject: [PATCH] Add easy media metadata support Use for accessibility like alternative text --- src/TwitterOAuth.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/TwitterOAuth.php b/src/TwitterOAuth.php index db361a9b..e65af32f 100644 --- a/src/TwitterOAuth.php +++ b/src/TwitterOAuth.php @@ -296,6 +296,25 @@ public function upload( } } + /** + * Add metadata of media upload. + * + * @param string $media_id + * @param array $parameters + * + * @return array|object + */ + public function mediaMeta(string $media_id, array $parameters = []) + { + return $this->http( + 'POST', + self::UPLOAD_HOST, + 'media/metadata/create', + array_merge( [ 'media_id' => $media_id ], $parameters ), + true + ); + } + /** * Progression of media upload *