activeEditor = $activeEditor; $this->placeholderImages = $placeholderImages; $this->assetRepo = $assetRepo; } /** * @param \Magento\Widget\Model\Widget $subject * @param \Closure $proceed * @param string $type * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundGetPlaceholderImageUrl( \Magento\Widget\Model\Widget $subject, \Closure $proceed, string $type ) : string { if ($this->activeEditor->getWysiwygAdapterPath() !== Editor::WYSIWYG_EDITOR_CONFIG_VALUE) { return $proceed($type); } $placeholders = $this->placeholderImages->getWidgetPlaceholders(); $defaultImage = $this->assetRepo->getUrl('Magento_Tinymce3::images/widget/placeholder.png'); if (isset($placeholders[$type])) { return $this->assetRepo->getUrl($placeholders[$type]); } return $defaultImage; } }