Skip to content

Commit 71478c7

Browse files
authored
Merge pull request #9 from picogp/patch-1
Add support for REELS
2 parents 00258cd + 628f136 commit 71478c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Instagram/User/Media.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function create( $params ) {
7878
'params' => $params ? $params : array()
7979
);
8080

81-
if ( isset( $params[Params::VIDEO_URL] ) ) { // video container requires more params
82-
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::VIDEO;
81+
if ( 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
82+
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::VIDEO;
8383
} elseif ( isset( $params[Params::CHILDREN] ) ) { // carousel container requires more params
8484
$postParams['params'][Params::MEDIA_TYPE] = MediaTypes::CAROUSEL;
8585
}
@@ -129,4 +129,4 @@ public function getParams( $params = array() ) {
129129
}
130130
}
131131

132-
?>
132+
?>

0 commit comments

Comments
 (0)