PluginProbe
Panorama – Turn Photos into Immersive Virtual Tours / trunk
Panorama – Turn Photos into Immersive Virtual Tours vtrunk
1.8.0 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.1 trunk 1.0.0 1.0.1 1.0.10 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.3 1.1.4 1.1.5 1.1.6 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 All 38 releases
panorama / blocks / gallery.php

gallery.php in Panorama – Turn Photos into Immersive Virtual Tours trunk, at blocks/gallery.php

50 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 $bppiv_block = call_user_func( function() use ( $get_value, $bppiv_meta ) {
7 $galleries = $get_value('bppiv_pan_gallery', false, [] );
8
9 $items = [];
10
11 foreach ($galleries as $key => $gallery) {
12 $items[] = [
13 "img" => $gallery['panoramic_img']['url'],
14 "isSetVideo" => (bool) $gallery['gal_type_cheek'],
15 "video" => $gallery['gal_type_video']['url'],
16 "fov" => isset($gallery['fov']) ? $gallery['fov'] : 85,
17 "initialPosition" => isset($gallery['initial_view_pos']) ? [
18 "x" => $gallery['initial_view_pos']['top'],
19 "y" => $gallery['initial_view_pos']['right'],
20 "z" => $gallery['initial_view_pos']['bottom']
21 ] : null,
22 "initialView" => isset($gallery['gallery_initial_view']) ? (bool)$gallery['gallery_initial_view'] : false
23 ];
24 }
25
26 return [
27 "blockName" => "panorama/gallery",
28 "attrs" => [
29 "galleries" => $items,
30 "galleryLimit" => (int)$get_value('bppiv_gallery_limit', false),
31 "column" => $get_value('bppiv_gallery_column', false),
32 "gap" => $get_value('bppiv_gallery_column_gap', false, 'width'),
33 "gap" => $bppiv_meta['bppiv_gallery_column_gap']['width'] . 'px' ,
34 "loadMoreBtn" => [
35 "text" => $get_value('loadMore_btn_text', false),
36 "colors" => [
37 "color" => $get_value('loadMore_text_color', false),
38 "bg" => $get_value('loadMore_btn_bg', false),
39 ],
40 "hoverColors" => [
41 "color" => $get_value('loadMore_text_hover_color', false),
42 "bg" => $get_value('loadMore_hover_bg', false),
43 ]
44 ]
45 ],
46 "innerBlocks" => [],
47 "innerHTML" => "",
48 "innerContent" => []
49 ];
50 } );