diff --git a/includes/admin/class-wc-admin.php b/includes/admin/class-wc-admin.php index 0d95cb3b097..d171da2323d 100644 --- a/includes/admin/class-wc-admin.php +++ b/includes/admin/class-wc-admin.php @@ -22,6 +22,7 @@ class WC_Admin { * Constructor. */ public function __construct() { + add_action( 'plugins_loaded', array( $this, 'preload_helper' ) ); add_action( 'init', array( $this, 'includes' ) ); add_action( 'current_screen', array( $this, 'conditional_includes' ) ); add_action( 'admin_init', array( $this, 'buffer' ), 1 ); @@ -86,6 +87,13 @@ class WC_Admin { include_once dirname( __FILE__ ) . '/helper/class-wc-helper.php'; } + /** + * Preloads functionality part of the Helper to be loaded on the `plugins_loaded` hook + */ + public function preload_helper() { + include_once dirname( __FILE__ ) . '/helper/class-wc-helper-file-headers.php'; + } + /** * Include admin files conditionally. */ diff --git a/includes/admin/helper/class-wc-helper-file-headers.php b/includes/admin/helper/class-wc-helper-file-headers.php new file mode 100644 index 00000000000..7db9c72b2c1 --- /dev/null +++ b/includes/admin/helper/class-wc-helper-file-headers.php @@ -0,0 +1,44 @@ +