From 2a243c65d69fec9f64a4c36cbd214513609441c6 Mon Sep 17 00:00:00 2001 From: jstolpe Date: Tue, 2 Jan 2024 20:58:46 -0600 Subject: [PATCH] media type updates for reels and stories --- src/Instagram/User/Media.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Instagram/User/Media.php b/src/Instagram/User/Media.php index b5df572..e81a4fa 100644 --- a/src/Instagram/User/Media.php +++ b/src/Instagram/User/Media.php @@ -80,10 +80,12 @@ public function create( $params ) { if ( isset( $params[Params::CHILDREN] ) ) { // carousel container requires more children params $postParams['params'][Params::MEDIA_TYPE] = MediaTypes::CAROUSEL; - } elseif ( isset( $params[Params::VIDEO_URL] ) && !isset( $postParams['params'][Params::MEDIA_TYPE] ) ) { // video container requires more params and to not overide in case REELS is passed + } elseif ( isset( $params[Params::VIDEO_URL] ) && !isset( $params[Params::MEDIA_TYPE] ) ) { // video container requires more params and to not overide in case REELS is passed $postParams['params'][Params::MEDIA_TYPE] = MediaTypes::VIDEO; - } elseif ( isset( $params[Params::VIDEO_URL] && isset( $postParams['params'][Params::MEDIA_TYPE] ) { // set url and type to whatever is passed in - $postParams['params'][Params::MEDIA_TYPE] = $postParams['params'][Params::MEDIA_TYPE]; + } elseif ( isset( $params[Params::VIDEO_URL] ) && isset( $params[Params::MEDIA_TYPE] ) ) { // set url and type to whatever is passed in + $postParams['params'][Params::MEDIA_TYPE] = $params[Params::MEDIA_TYPE]; + } elseif ( isset( $params[Params::IMAGE_URL] ) && isset( $params[Params::MEDIA_TYPE] ) ) { // set url and type to whatever is passed in + $postParams['params'][Params::MEDIA_TYPE] = MediaTypes::STORIES; } // ig get request