wpgenie

add 0 in front of ticket numbers

Oct 28th, 2020 (edited)
604
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter( 'ticket_number_display_html' , 'custom_change_prefic_ticket_numbers', 10, 2 );
  2. function custom_change_prefic_ticket_numbers ($data, $product){
  3.     $digits = strlen( $product->get_max_tickets() );
  4.     return str_pad($data, $digits, '0', STR_PAD_LEFT);
  5. }
RAW Paste Data