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. | |
| function woo_vou_change_vendor_role_name() { | |
| //get vendor role | |
| $vendor_role = get_role( WOO_VOU_VENDOR_ROLE ); | |
| if( !empty( $vendor_role ) ) { // if already added vendor role | |
| // first remove vendor role | |
| remove_role( WOO_VOU_VENDOR_ROLE ); |
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 | |
| //Create global variable for builder | |
| global $builder_object; | |
| //Assign builder object to global variable | |
| $builder_object = $builder; | |
| //Add action for remove builder functionality from voucher templates | |
| add_action( 'admin_init', 'avia_remove_builder_functionality' ); |
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 | |
| // For add custom PDF | |
| function woo_vou_add_custom_pdf_sizes( $pdf_sizes = array() ) { | |
| $pdf_sizes = array_merge( $pdf_sizes, array( | |
| 'A_Custom' => array( | |
| 'width' => 500, | |
| 'height' => 500, | |
| 'fontsize' => 50 |
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_vendor_can_redeem_all_codes( $roles = array() ) { | |
| $roles[] = 'shop_manager'; | |
| // you can add this code if you want to allow vendor role to check all voucher codes and other report pages | |
| //$roles[] = 'woo_vou_vendors'; | |
| return $roles; |
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 | |
| // Note : If you still do not get mail then please write any email id instead of '$fromemail' | |
| // Please add the below code to your theme functions file. | |
| function wpw_fp_set_email_to( $email, $fromemail ) { | |
| $email = $fromemail; // any custom email id, if you do not getting any mail | |
| return $email; | |
| } |
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 to handle the download image jpeg quality | |
| * Note : Value should be numeric and bettween 0 to 100 | |
| * | |
| * @param int $quality | |
| * @return $quality | |
| */ | |
| function edd_img_wtm_jpeg_quality( $quality ) { | |
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 to handle the download image png quality | |
| * Note : Value should be numeric and bettween 0 to 9 | |
| * | |
| * @param int $quality | |
| * @return $quality | |
| */ | |
| function edd_img_wtm_png_quality( $quality ) { | |