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 | |
| /** | |
| * If you want to remove Voucher status Widget area from the admin then use below code | |
| */ | |
| function woo_vou_remove_dashboard_widget(){ | |
| global $woo_vou_admin; | |
| remove_action( 'wp_dashboard_setup', array( $woo_vou_admin,'woo_vou_add_dashboard_widgets') ); | |
| } |
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 to remove the preview image | |
| */ | |
| function woo_vou_preview_img_func( $img_file ) { | |
| return ''; | |
| } | |
| // Add filter to remove the preview image | |
| add_filter('woo_vou_preview_img', 'woo_vou_preview_img_func' ); |
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 // Do not add this if it's already added. | |
| /** | |
| * Modify the "Preview" title and text on single product page | |
| */ | |
| function woo_vou_preview_pdf_title_func( $preview_title ) { | |
| return __('Preview Voucher', 'woovoucher'); | |
| } | |
| // Add filter to modify the "Preview" title and text on single product page | |
| add_filter('woo_vou_preview_pdf_title', 'woo_vou_preview_pdf_title_func' ); |
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 | |
| /** | |
| * Handles to change download button text on downloads page | |
| */ | |
| function woo_vou_download_page_vou_download_btn_func($btn_name, $product_id, $product_name, $download_file, $voucher_number, $order_date){ | |
| return __("Download {$voucher_number} ( {$order_date} )", 'woovoucher'); | |
| } | |
| add_filter( 'woo_vou_download_page_vou_download_btn', 'woo_vou_download_page_vou_download_btn_func', 10, 6 ); |
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 | |
| function woo_vou_cstm_recipient_input_html_func($html, $variation_id, $maxlength, $recipient_col_val, $recipient_column){ | |
| $prefix = WOO_VOU_META_PREFIX; | |
| return '<textarea '. $maxlength .' class="woo-vou-recipient-details" id="'.$recipient_column.'-'.$variation_id.'" name="'. $prefix.$recipient_column.'['.$variation_id.']">'.$recipient_col_val.'</textarea>'; | |
| } | |
| add_filter( 'woo_vou_cstm_recipient_input_html', 'woo_vou_cstm_recipient_input_html_func', 10, 5 ); | |
| ?> |
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 | |
| // Define constant | |
| if( !defined( 'WOO_VOU_CSTM_RECIPIENT_FIELD' ) ) { | |
| define( 'WOO_VOU_CSTM_RECIPIENT_FIELD', 'recipient_from_name' ); | |
| } | |
| /** | |
| * Add new Recipient field information in recipient details array | |
| */ |
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 // Do not add this if its already added in file | |
| /* | |
| * By default plugin use WordPress date and time format set in Settings -> General page | |
| * | |
| * If you want to change date format without changing general settings then you can use this code | |
| */ | |
| function woo_vou_change_date_format($format ) { | |
| $format = 'F j, Y g:i a'; // June 7, 2018 11:39 am | |
| return $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 // Do not add this if its already added. | |
| /** | |
| * WooCoommerce Pre Orders adding timepicker js in header and that's why WooCommerce product add/edit page not working. | |
| * | |
| * Solution is remove timepicker js and add it again but in footer | |
| */ | |
| function woo_vou_resolve_conflict_with_pre_orders( $hook_suffix ) { | |
| if( in_array( $hook_suffix, array( 'post.php', 'post-new.php') ) ) { |
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 | |
| // Function use to change the date format from Y-m-d to d-m-Y at all those places where PDF/CSV is downloaded | |
| function woo_vou_voucher_date_format_func($date_format){ | |
| /* | |
| * If you are not using English as your site's default language, then we would recommend you to use fromats from 'Y-m-d' or 'd-m-Y' | |
| * Also we recommend using dash('-') rather then other seperator | |
| */ | |
| $date_format = 'd-m-Y'; | |
| return $date_format; |