📅  最后修改于: 2022-03-11 14:55:53.002000             🧑  作者: Mango
/**
* Add PDF invoice information meta (from third party plugins).
*
* @param array $info Invoice info meta.
* @param BEWPI_Invoice $invoice Invoice object.
* @since 2.9.8
*
* @return array.
*/
function add_invoice_information_meta( $info, $invoice ) {
// Add VAT Number from 'WooCommerce EU VAT Number' plugin.
$vat_number = WPI()->get_meta( $invoice->order, '_vat_number' );
if ( $vat_number ) {
$info['vat_number'] = array(
'title' => __( 'VAT Number:', 'woocommerce-pdf-invoices' ),
'value' => $vat_number,
);
}
return $info;
}
add_filter( 'wpi_invoice_information_meta', 'add_invoice_information_meta', 10, 2 );