Created
May 11, 2021 10:21
-
-
Save jjmontalban/8e2c3199739650378d054d8baec1d131 to your computer and use it in GitHub Desktop.
Add custom Woocommerce metqa fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @snippet Añadir campos a la ficha de cliente () | |
* @author https://jjmontalban.github.io/ | |
*/ | |
add_filter( 'woocommerce_customer_meta_fields', 'custom_woocommerce_customer_meta_fields' ); | |
//Añade el campo CIF y teléfono 2 a usuarios | |
function custom_woocommerce_customer_meta_fields( $fields ) { | |
$fields['billing']['fields']['billing_phone2'] = array( 'label' => __( 'Teléfono 2', 'woocommerce' ), 'description' => 'Teléfono alternativo'); | |
$fields['billing']['fields']['billing_cif'] = array( 'label' => __( 'CIF/NIF', 'woocommerce' ), 'description' => ''); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment