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.
Метод класса: WooCommerce{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$WooCommerce = new WooCommerce(); $WooCommerce->add_generate_category_lookup_table_wrapper();
Код WooCommerce::add_generate_category_lookup_table_wrapper() WooCommerce::add generate category lookup table wrapper WC 11.0.1
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' );
}