WooCommerce::add_generate_category_lookup_table_wrapper
Wrapper for the generate_category_lookup_table 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_generate_category_lookup_table_wrapper();
WooCommerce::add_generate_category_lookup_table_wrapper() WooCommerce::add generate category lookup table wrapper code WC 10.7.0
public function add_generate_category_lookup_table_wrapper() {
try {
if ( class_exists( \Automattic\WooCommerce\Internal\Admin\CategoryLookup::class ) ) {
\Automattic\WooCommerce\Internal\Admin\CategoryLookup::instance();
}
} catch ( Throwable $e ) {
wc_get_logger()->error( 'Error in category lookup wrapper: ' . $e->getMessage(), array( 'source' => 'woocommerce-scheduled-actions' ) );
}
// phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
do_action( 'generate_category_lookup_table' );
}