Created
September 6, 2019 11:43
-
-
Save wpweb101/67cb975ae0f9bc8f4b37f4c479d60db2 to your computer and use it in GitHub Desktop.
WooCommerce Pdf Vouchers - Function to change {booking_date} shortcode date format
This file contains hidden or 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 | |
| add_filter( 'woo_vou_pdf_template_replace_shortcodes', 'woo_vou_pdf_change_booking_date_shortcodes', 999, 6 ); | |
| function woo_vou_pdf_change_booking_date_shortcodes( $woo_vou_details, $orderid, $item_key, $items, $voucodes, $productid ){ | |
| // code to change booking date shortcode date format on voucher pdf | |
| if( isset( $woo_vou_details['booking_date'] ) && !empty( $woo_vou_details['booking_date'] ) ){ | |
| $woo_vou_details['booking_date'] = date( 'Y-M-D', strtotime( $woo_vou_details['booking_date'] ) ); | |
| } | |
| return $woo_vou_details; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment