Dear Viljami, thanks for a great plug-in! It rocks.
Not really an issue. But how would you suggest to intercept add_filter('template_include', '_locate_pdf_template') to return same fixed path no matter what?
This is how i'm doing it now – theme's functions.php:
// PDF template handling
add_filter('template_include', 'theme_locate_pdf_template', 11);
function theme_locate_pdf_template($template) {
global $wp_query;
if (isset($wp_query->query_vars['pdf-template'])) {
$template = get_template_directory() . '/pdf/pdf.php';
}
return $template;
}
@pooledge Thanks for this! Adding a higher priority makes it works with page builders, like elementor, that replaces templates for woocommerce, while still maintaining the regular non-pdf-template :rocket:
Dear Viljami, thanks for a great plug-in! It rocks. Not really an issue. But how would you suggest to intercept
add_filter('template_include', '_locate_pdf_template')
to return same fixed path no matter what?This is how i'm doing it now – theme's functions.php: