1
0
Files
re_capitulating_queer/site/plugins/embed/lib/fieldMethods.php
Philip Wagner 78b6c0d381 init
2024-08-31 10:01:49 +02:00

15 lines
414 B
PHP

<?php
use Kirby\Cms\Content;
return array(
'toEmbed' => function($field) {
// allows if($embed = $page->myfield()->toEmbed()) { echo $embed->code() }
if($field->isEmpty() || !count(Yaml::decode($field->value)) || empty($field->yaml()['media'])) {
return null;
}
$content = new Content($field->yaml()['media'], $field->parent());
return $content;
},
);