From 10eb9f832e7a1b5a2a5c520d9c648925d84e5bde Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Mon, 11 Jan 2021 16:21:52 +0100 Subject: [PATCH] Remove one of the duplicate handlers for 'adjust_download_permissions' --- includes/class-woocommerce.php | 3 --- src/Internal/DownloadPermissionsAdjuster.php | 8 -------- 2 files changed, 11 deletions(-) diff --git a/includes/class-woocommerce.php b/includes/class-woocommerce.php index 22d6efd223b..6a03eecbb55 100644 --- a/includes/class-woocommerce.php +++ b/includes/class-woocommerce.php @@ -8,7 +8,6 @@ defined( 'ABSPATH' ) || exit; -use Automattic\WooCommerce\Internal\DownloadPermissionsAdjuster; use Automattic\WooCommerce\Proxies\LegacyProxy; /** @@ -203,8 +202,6 @@ final class WooCommerce { add_action( 'switch_blog', array( $this, 'wpdb_table_fix' ), 0 ); add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); add_action( 'deactivated_plugin', array( $this, 'deactivated_plugin' ) ); - - DownloadPermissionsAdjuster::init_hooks(); } /** diff --git a/src/Internal/DownloadPermissionsAdjuster.php b/src/Internal/DownloadPermissionsAdjuster.php index 18fdea7478c..2169c14e5ff 100644 --- a/src/Internal/DownloadPermissionsAdjuster.php +++ b/src/Internal/DownloadPermissionsAdjuster.php @@ -26,14 +26,6 @@ final class DownloadPermissionsAdjuster { add_action('adjust_download_permissions', array($this, 'adjust_download_permissions'), 10, 1); } - /** - * Initialize the hooks used by this class. - */ - public static function init_hooks() - { - add_action('adjust_download_permissions', array(wc_get_container()->get(self::class), 'adjust_download_permissions'), 10, 1); - } - /** * Schedule a download permissions adjustment for a product if necessary. * This should be executed whenever a product is saved.