Forked from woogists/wc-display-custom-checkout-field-order.php
Created
October 3, 2020 19:10
-
-
Save bobwol/ca906771e7bd83f3377475baa9743118 to your computer and use it in GitHub Desktop.
[Customizing checkout fields using actions and filters] Display WooCommerce custom checkout field admin order page.
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
/** | |
* Display field value on the order edit page | |
*/ | |
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); | |
function my_custom_checkout_field_display_admin_order_meta($order){ | |
echo '<p><strong>'.__('My Field').':</strong> ' . get_post_meta( $order->id, 'My Field', true ) . '</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment