From 5cc2c590d5eea65d1acddb3b2a83417c5c29c71e Mon Sep 17 00:00:00 2001 From: ndpatelce05 <39831855+ndpatelce05@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:53:11 +0530 Subject: [PATCH] Update plugins.md Docs: Replace incorrect __construct plugin example with valid magic method example. Removed an invalid example showing a plugin applied to the __construct method, which contradicts documented plugin limitations. Replaced it with a functional example of intercepting PHP magic methods (__get and __call) based on verified community solutions on https://magento.stackexchange.com/questions/309817/how-to-change-product-images-with-external-image-url-in-all-magento-2-frontend-a#answer-309826 --- src/pages/development/components/plugins.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/pages/development/components/plugins.md b/src/pages/development/components/plugins.md index bce4dd661..df08a4e9d 100644 --- a/src/pages/development/components/plugins.md +++ b/src/pages/development/components/plugins.md @@ -78,22 +78,13 @@ In the plugin class, the `setName` method may have one of the following names: If the first letter in the name of the class method name for which you want to create a plugin is the `underscore` character, then you do not need to capitalize it in the plugin class. -For example, to create a plugin for the `_construct` method of some class: +You can use plugins (interceptors) on PHP magic methods, such as `__get`, `__set`, or `__call`. The Adobe Commerce and Magento Open Source dependency injection system allows interceptors to wrap these magic methods just like standard public methods. -```php -... - public function _construct() - { - ... - } -... -``` - -Use the following method names for the `_construct` method in the plugin class: +Use the following method names for the `_get` method in the plugin class: -* `before_construct` -* `around_construct` -* `after_construct` +* `before_get` +* `around_get` +* `after_get` ## Before methods