The code:
echo do_shortcode('[wcpdf_download_pdf document_type="invoice" link_text="print" order_id="5746"]');
works on front end but it doesn’t work on ‘manage_woocommerce_page_wc-orders_custom_column’ action hook, in this hook other shortcodes work just fine. My problem is that it also doesn’t throw an error. How can I force a shortcode to run correctly?
add_action('manage_woocommerce_page_wc-orders_custom_column', 'factor_rows', 10, 2);
function factor_rows($column, $order)
{
if ('print' == $column) {
echo do_shortcode('[wcpdf_download_pdf order_id="5746"]');
}
}
I tried other shortcodes and they worked fine and I also tried it elsewhere and it also worked fine it’s just the shortcode doesn’t work on that action hook. Error logging the shortcode returns empty string.
1