Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Forked from woogist/gist:6267983
Last active January 15, 2018 19:48
Show Gist options
  • Select an option

  • Save mikejolley/9971149 to your computer and use it in GitHub Desktop.

Select an option

Save mikejolley/9971149 to your computer and use it in GitHub Desktop.

Revisions

  1. mikejolley revised this gist Apr 4, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    /**
    * Display field value on the order edition page
    **/
    * 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> ' . $order->order_custom_fields['My Field'][0] . '</p>';
    echo '<p><strong>'.__('My Field').':</strong> ' . get_post_meta( $order->id, 'My Field', true ) . '</p>';
    }
  2. @woogist woogist created this gist Aug 19, 2013.
    8 changes: 8 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    /**
    * Display field value on the order edition 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> ' . $order->order_custom_fields['My Field'][0] . '</p>';
    }