WooCommerce::add_wc_admin_daily_wrapperpublicWC 1.0

Wrapper for the wc_admin_daily This prevents the event failing when the class is not loaded. It loads the class if it exists, and then calls the actual action.

Method of the class: WooCommerce{}

Hooks from the method

Returns

null. Nothing (null).

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->add_wc_admin_daily_wrapper();

WooCommerce::add_wc_admin_daily_wrapper() code WC 10.4.3

public function add_wc_admin_daily_wrapper() {
	try {
		if ( class_exists( \Automattic\WooCommerce\Internal\Admin\Events::class ) ) {
			\Automattic\WooCommerce\Internal\Admin\Events::instance();
		}
	} catch ( Throwable $e ) {
		wc_get_logger()->error( 'Error initializing wc_admin_daily: ' . $e->getMessage(), array( 'source' => 'woocommerce-scheduled-actions' ) );
	}
	// phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
	do_action( 'wc_admin_daily' );
}