Skip to content

Instantly share code, notes, and snippets.

@wisecrab
Created September 2, 2015 20:38
Show Gist options
  • Save wisecrab/92507fdbecac8ce3410f to your computer and use it in GitHub Desktop.
Save wisecrab/92507fdbecac8ce3410f to your computer and use it in GitHub Desktop.
<?php
/***********************************************************************************
These are examples and references for the WooCommerce Order Item meta data hooks
that is displayed in the admin side of WordPress when viewing a customer's order.
***********************************************************************************/
//Do Something before the order item's meta data
do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $_product );
//Do Something after the order item's meta data
do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, $_product );
//Display a message above the item meta data
function display_message_above() {
echo '<p>Here is my content above the item meta data!</p>';
}
add_filter( 'woocommerce_hidden_order_itemmeta', 'display_message_above' );
//Display a message below the item meta data
function display_message_below() {
echo '<p>Here is my content below the item meta data!</p>';
}
add_filter( 'woocommerce_hidden_order_itemmeta', 'display_message_below' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment