Add auto registration using the interface
This commit is contained in:
parent
87b11e3bbb
commit
95001377b6
|
@ -16,6 +16,7 @@ use Automattic\WooCommerce\Internal\Features\FeaturesController;
|
|||
use Automattic\WooCommerce\Internal\ProductAttributesLookup\DataRegenerator;
|
||||
use Automattic\WooCommerce\Internal\ProductAttributesLookup\LookupDataStore;
|
||||
use Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Register as ProductDownloadDirectories;
|
||||
use Automattic\WooCommerce\Internal\RegisterHooksInterface;
|
||||
use Automattic\WooCommerce\Internal\RestockRefundedItemsAdjuster;
|
||||
use Automattic\WooCommerce\Internal\Settings\OptionSanitizer;
|
||||
use Automattic\WooCommerce\Internal\Utilities\WebhookUtil;
|
||||
|
@ -262,6 +263,16 @@ final class WooCommerce {
|
|||
$container->get( FeaturesController::class );
|
||||
$container->get( WebhookUtil::class );
|
||||
$container->get( Marketplace::class );
|
||||
|
||||
/**
|
||||
* These classes have a register method for attaching hooks.
|
||||
*
|
||||
* @var RegisterHooksInterface[] $hook_register_classes
|
||||
*/
|
||||
$hook_register_classes = $container->get( RegisterHooksInterface::class );
|
||||
foreach ( $hook_register_classes as $hook_register_class ) {
|
||||
$hook_register_class->register();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue