Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zackeryfretty/c2930226566f8615f69fc4b9c9180a99 to your computer and use it in GitHub Desktop.
Save zackeryfretty/c2930226566f8615f69fc4b9c9180a99 to your computer and use it in GitHub Desktop.
function zf_sequential_order_yaymail_shortcode( $shortcode_list, $yaymail_informations, $args = array() ) {
// Real Order Lookup
if (isset ($args['order'])) {
$order = $args['order'];
$order_id = $order->get_order_number();
return $order_id;
}
// YayMail Preview
return 'PRE_XXXX';
}
add_filter(
'yaymail_customs_shortcode',
function( $shortcode_list, $yaymail_informations, $args = array() ) {
$shortcode_list['[yaymail_custom_shortcode_sequential_order_number]'] = zf_sequential_order_yaymail_shortcode($shortcode_list, $yaymail_informations, $args);
return $shortcode_list;
},
10,
3
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment