public function getOEmbed() { $oembed = parent::getOEmbed(); if ($this->embedCode && $this->oembed) { $width = $this->oembed->get('width'); $height = $this->oembed->get('height'); $this->attributes(['width' => $width, 'height' => $height]); } return $oembed; }
public function getOEmbed() { $oembed = parent::getOEmbed(); $sizes = ['width', 'height']; foreach ($sizes as $key) { $size = isset($oembed[$key]) ? $oembed[$key] : 0; if (!preg_match('~^\\d+$~', $size)) { $oembed[$key] = 0; } } return $oembed; }