PluginProbe
Getwid – Gutenberg Blocks / 2.0.11
Getwid – Gutenberg Blocks v2.0.11
3.0.2 3.0.1 3.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.2.0 trunk 1.8.7 1.9.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9
getwid / includes / templates / instagram / post.php

post.php in Getwid – Gutenberg Blocks 2.0.11, at includes/templates/instagram/post.php

32 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Post template in Instagram Block
4 */
5
6 $block_name = $extra_attr['block_name'];
7 $post = $extra_attr['post'];
8 $alt = '';
9
10 if ( isset($post->caption) ) {
11 $alt = wp_trim_words( $post->caption );
12 }
13
14 /*
15 *
16 * media_type
17 * The Media's type. Can be IMAGE, VIDEO, or CAROUSEL_ALBUM.
18 * https://developers.facebook.com/docs/instagram-basic-display-api/reference/media/#fields
19 */
20
21 ?>
22 <div class="<?php echo esc_attr($block_name) . '__item'; ?>">
23 <div class="<?php echo esc_attr($block_name) . '__media-wrapper'; ?>">
24 <a class="<?php echo esc_attr($block_name) . '__media-link'; ?>" target="_blank" href="<?php echo esc_url($post->permalink); ?>">
25 <?php if ($post->media_type == 'IMAGE' || $post->media_type == 'CAROUSEL_ALBUM') { ?>
26 <img class="<?php echo esc_attr($block_name) . '__media'; ?>" src="<?php echo esc_url($post->media_url); ?>" alt="<?php echo esc_attr($alt); ?>"/>
27 <?php } elseif ($post->media_type == 'VIDEO'){ ?>
28 <img class="<?php echo esc_attr($block_name) . '__media'; ?>" src="<?php echo esc_url($post->thumbnail_url); ?>" alt="<?php echo esc_attr($alt); ?>"/>
29 <?php } ?>
30 </a>
31 </div>
32 </div>