Created
November 27, 2019 14:54
-
-
Save forsvunnet/dfb17cb85b984b882c3f48b256b482a5 to your computer and use it in GitHub Desktop.
Custom text field in woocommerce checkout customizer
This file contains hidden or 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 | |
/** | |
* Add our Customizer content | |
*/ | |
add_action( 'customize_register', function( $wp_customize ) { | |
$wp_customize->add_setting( 'delivery_address_text', | |
array( | |
'default' => 'By default we deliver the products to the billing address. If you want the shipment delivered on a different location please select this option:', // Optional. | |
'type' => 'theme_mod', | |
) | |
); | |
$wp_customize->add_control( 'delivery_address_text', | |
array( | |
'label' => __( 'Default Text Control' ), | |
'description' => esc_html__( 'Delivery address information' ), | |
'section' => 'woocommerce_checkout', | |
'type' => 'textarea', | |
) | |
); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment