PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.0.1
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.0.1
9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 8.5.4 All 221 releases
wpvr / src / Api / Repositories / TourRepository.php

TourRepository.php in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 9.0.1, at src/Api/Repositories/TourRepository.php

25 lines 709 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RexTheme\WPVR\Api\Repositories;
4
5 use RexTheme\WPVR\Api\Contracts\RepositoryInterface;
6
7 class TourRepository implements RepositoryInterface {
8
9 const META_KEY = 'panodata';
10
11 public function find( int $id ): array {
12 $raw = get_post_meta( $id, self::META_KEY, true );
13 return is_array( $raw ) ? $raw : [];
14 }
15
16 public function save( int $id, array $data ): bool {
17 $result = update_post_meta( $id, self::META_KEY, $data );
18 // update_post_meta returns false both on real failure and when value is unchanged
19 if ( false === $result ) {
20 return get_post_meta( $id, self::META_KEY, true ) == $data;
21 }
22 return true;
23 }
24 }
25