Skip to content

Commit 2a243c6

Browse files
committed
media type updates for reels and stories
1 parent b6c6b54 commit 2a243c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Instagram/User/Media.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ public function create( $params ) {
8080

8181
if ( isset( $params[Params::CHILDREN] ) ) { // carousel container requires more children params
8282
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::CAROUSEL;
83-
} 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
83+
} 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
8484
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::VIDEO;
85-
} elseif ( isset( $params[Params::VIDEO_URL] && isset( $postParams['params'][Params::MEDIA_TYPE] ) { // set url and type to whatever is passed in
86-
$postParams['params'][Params::MEDIA_TYPE] = $postParams['params'][Params::MEDIA_TYPE];
85+
} elseif ( isset( $params[Params::VIDEO_URL] ) && isset( $params[Params::MEDIA_TYPE] ) ) { // set url and type to whatever is passed in
86+
$postParams['params'][Params::MEDIA_TYPE] = $params[Params::MEDIA_TYPE];
87+
} elseif ( isset( $params[Params::IMAGE_URL] ) && isset( $params[Params::MEDIA_TYPE] ) ) { // set url and type to whatever is passed in
88+
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::STORIES;
8789
}
8890

8991
// ig get request

0 commit comments

Comments
 (0)