Magento 块自定义插件

我有问题,因为第三方模块在类 Magento\Framework\Config\View 上有插件 aroundGetMediaAttributes,sortOrder=10。这个插件修改图像大小。我需要阻止这个插件并从核心函数返回结果,但我不知道该怎么做。 此外,我仅在某些情况下才需要阻止自定义插件,并非总是如此。 我在 GetMediaAttributes 周围创建了第二个插件,具有更高的 sortOrder 并从 callable 返回结果,但仍然有错误的图像大小。 我该如何解决?

jlgrt 回答:Magento 块自定义插件

您可以按名称禁用插件:

<type name="Vendor\Module\Path\To\Class">
    <plugin name="plugin_name" disabled="true" />
</type>
本文链接:https://www.f2er.com/1478.html

大家都在问