Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created March 19, 2015 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/3e25aa55cf65255ee314 to your computer and use it in GitHub Desktop.
Save SiR-DanieL/3e25aa55cf65255ee314 to your computer and use it in GitHub Desktop.
/**
* Add the meta _transaction_id in the search fields.
*
* @param array $fields
* @return array
*/
function wc_custom_order_filter_fields( $fields ) {
if ( ! in_array( '_transaction_id', $fields ) ) {
array_push( $fields, '_transaction_id' );
}
return $fields;
}
add_filter( 'woocommerce_shop_order_search_fields', 'wc_custom_order_filter_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment