To display custom data , I use this hook 'woocommerce_checkout_create_order_line_item'. He works good. But it displays data in three places - in the admin panel (in order), in the order details and in the personal account. I need the data to be displayed only in the admin panel. how to do it? My code
add_action( 'woocommerce_checkout_create_order_line_item', 'wdm_add_custom_order_line_item_meta', 10, 4 );
function wdm_add_custom_order_line_item_meta( $item, $cart_item_key, $values, $order )
{
if ( array_key_exists( 'file', $values ) ) {
$product_id = $item->get_product_id();
$permfile = $values['file'];
$basePath = plugin_base_url();
$fileid = $permfile;
....
$item->add_meta_data('File','<button > <a href="'.$fileid.'" download>' . Download. '</a></button>');
}
}

