Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created March 21, 2017 09:09
Show Gist options
  • Select an option

  • Save kreamweb/371126b5e9c882814dd7e59286a76d34 to your computer and use it in GitHub Desktop.

Select an option

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
<?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