Issue when using trp_stop_translating_page filter
-
Hi there!
I’m using the filter
add_filter( 'trp_stop_translating_page', '__return_true' );to stop translating an Ajax request which returns a PDF file.I have something like this:
add_action('wp_ajax_nopriv__save_to_pdf', 'ajax_save_to_pdf' );
function ajax_save_to_pdf() {
add_filter( 'trp_stop_translating_page', '__return_true' );
// ... the logic
echo $dompdf->output();
exit;
}This successfully disable the translation (which was breaking the PDF).
However the strings contain Translatepress markup.
E.g. #!trpst#trp-gettext data-trpgettextoriginal=9736#!trpen#Total#!trpst#/trp-gettext#!trpen#
How can I prevent this? Do I need to add the filter earlier in the WP cycle?
Marc
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Issue when using trp_stop_translating_page filter’ is closed to new replies.