Commit 197f5503 authored by Isaque Melo's avatar Isaque Melo

Fix media type video

parent 1c488803
......@@ -51,7 +51,7 @@ add_action( 'rest_api_init', function () {
function instagram_auth($data) {
// $redirect_url = 'https://localhost/wp-json/guaraci/auth/instagram/';
//$redirect_url = 'https://localhost/wp-json/guaraci/auth/instagram/';
$redirect_url = site_url(). '/wp-json/guaraci/auth/instagram/';
$authorization_code = $data['code'];
......
......@@ -40,6 +40,7 @@ if($result === false){
array_push($medias_data, [
'link' => $media_object->permalink,
'source_url' => $media_object->media_url,
'type' => $media_object->media_type
]);
//var_dump($media_object);
......@@ -73,9 +74,11 @@ if($result === false){
<div class="medias" style="grid-template-columns: repeat(<?= $instance['colunm_qnty'] ?>, 1fr);">
<?php foreach(array_slice($medias_data, 0, $limit) as $media): ?>
<?php if($media['type'] != 'VIDEO'): ?>
<a href="<?= $media['link'] ?>" <?= $instance['new_tab']? 'target="__blank"' : true ?>>
<img src="<?= $media['source_url'] ?>" alt="">
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment