Skip to content

Commit

Permalink
media type updates for reels and stories
Browse files Browse the repository at this point in the history
  • Loading branch information
jstolpe committed Jan 3, 2024
1 parent b6c6b54 commit 2a243c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Instagram/User/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a243c6

Please sign in to comment.