All checks were successful
Deploy / Deploy to Production (push) Successful in 8s
20 lines
628 B
PHP
20 lines
628 B
PHP
<?php
|
|
|
|
Kirby::plugin('studio-variable/file-methods', [
|
|
'fileMethods' => [
|
|
// Orientation utilisable aussi pour les vidéos.
|
|
// Kirby ne sait pas lire les dimensions d'une vidéo nativement,
|
|
// on se base donc sur le toggle « isPortrait » du panel pour celles-ci.
|
|
'fileOrientation' => function () {
|
|
if ($this->type() === 'video') {
|
|
return $this->isPortrait()->isTrue() ? 'portrait' : 'landscape';
|
|
}
|
|
|
|
if ($this->type() === 'image') {
|
|
return $this->orientation();
|
|
}
|
|
|
|
return false;
|
|
}
|
|
]
|
|
]);
|