Created
March 21, 2017 09:09
-
-
Save kreamweb/371126b5e9c882814dd7e59286a76d34 to your computer and use it in GitHub Desktop.
This code return the images of logo and thumbnails path instead of URL that isn't supported by some server
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( defined('YITH_YWRAQ_PREMIUM') ){ | |
| add_filter( 'ywraq_pdf_logo', 'ywraq_change_pdf_logo' ); | |
| function ywraq_change_pdf_logo( $logo ) { | |
| $logo_id = get_option( 'ywraq_pdf_logo-yith-attachment-id' ); | |
| $logo = get_attached_file( $logo_id ); | |
| return $logo; | |
| } | |
| add_filter( 'ywraq_pdf_product_thumbnail', 'ywraq_change_pdf_product_thumbnail', 10 , 2 ); | |
| function ywraq_change_pdf_product_thumbnail( $url, $id ){ | |
| if( $id ){ | |
| $url = get_attached_file( $id ); | |
| } | |
| return $url; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment