Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
firepot
/
themes
/
momota
/
lib
/
colibriwp
/
src
/
Customizer
/
Controls
:
VideoControl.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace ColibriWP\Theme\Customizer\Controls; class VideoControl extends ImageControl { // use ColibriWPControlsAdapter; public $mime_type = 'video'; public function to_json() { parent::to_json(); $attachment = isset( $this->json['attachment'] ) ? $this->json['attachment'] : null; /* * When external video is used an attachment is returned with type document. So if no attachment is returned or if * the type is document we make the assumption that an external url is used */ if ( ! $attachment || ( $attachment && $attachment['type'] === 'document' ) ) { $this->updateAttachmentToAllowExternal(); } } }