| | |
| | | |
| | | use JVBase\managers\SEO\render\Thing\CreativeWork\MediaObject\ImageObject; |
| | | use JVBase\managers\SEO\render\Thing\CreativeWork\Photograph; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Fields; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | |
| | | 'hint' => 'A photograph of this place.' |
| | | ]; |
| | | } |
| | | public function setPhotoField(Fields $fields):void |
| | | { |
| | | $fields->addField( |
| | | 'outside_photo', |
| | | [ |
| | | 'type' => 'image', |
| | | 'limit' => 1, |
| | | 'label' => __('Outside Photo', 'jvb') |
| | | ] |
| | | ); |
| | | } |
| | | |
| | | public function formatPhotoField(Meta $meta):void |
| | | { |
| | | $image = $meta->get('outside_photo'); |
| | | if (!empty($image) && $image > 0) { |
| | | $image = $this->createImageFromID($image); |
| | | if ($image) { |
| | | $this->setPhoto($image); |
| | | } |
| | | } |
| | | } |
| | | } |