Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
custom_attributes_rollback.php
Go to the documentation of this file.
1 <?php
8 
10  'test_attribute',
11 ];
12 
13 foreach ($attributeCodes as $attributeCode) {
15  $attribute = $objectManager->create(\Magento\Eav\Model\Entity\Attribute::class);
16  $attribute->loadByCode('catalog_product', $attributeCode);
17  if ($attribute->getId()) {
18  $attribute->delete();
19  }
20 }
$attributeCode
Definition: extend.phtml:12