hooks(); (new TableAdmin())->hooks(); (new ProAdmin())->hooks(); (new IndexAdmin())->hooks(); (new HelpAdmin())->hooks(); (new AttributeIndex())->hooks(); (new Frontend())->hooks(); add_action('rest_api_init', [new RestController(), 'register']); add_action('before_delete_post', [self::class, 'deleteProduct']); } public static function deleteProduct(int $postId): void { if (get_post_type($postId) === 'product') { (new Repository())->deleteProduct($postId); } } public static function missingWooNotice(): void { if (!current_user_can('activate_plugins')) { return; } echo '

' . esc_html__('FacetCore requires WooCommerce.', 'facetcore') . '

'; } }