Created
August 31, 2021 09:45
-
-
Save PechenkiUA/144b012279d08405e3c0df529b86302f to your computer and use it in GitHub Desktop.
wc telsender all meta
This file contains 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 | |
/* Telsender all meta*/ | |
function meta_wc_function($list, $order_id) | |
{ | |
$order = wc_get_order($order_id); | |
$allmeta = $order->get_meta_data(); | |
$mmeta = ''; | |
foreach ($allmeta as $key => $meta) { | |
$d = $meta->get_data(); | |
$mmeta .= sprintf('{%s} : %s', $d['key'], $d['value']); | |
$mmeta .= PHP_EOL; | |
} | |
$list['{all-meta}'] = $mmeta; | |
return $list; | |
} | |
add_filter('tscf_filter_codetemplate', 'meta_wc_function', 20, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment