| @@ -190,8 +190,10 @@ | ||
| 190 | 190 | } |
| 191 | 191 | if (!apply_filters('e2pdf_prevent_access_to_fields_on_non_public_posts', true)) { |
| 192 | 192 | add_filter('acf/shortcode/prevent_access_to_fields_on_non_public_posts', [$this->helper, '__return_false'], 999); |
| 193 | 193 | } |
| 194 | + add_filter('acf/load_value', [$this, 'filter_acf_load_value'], 999); | |
| 195 | + add_filter('do_shortcode_tag', [$this, 'filter_do_shortcode_tag_acf'], 999, 2); | |
| 194 | 196 | } |
| 195 | 197 | add_filter('jet-engine/listings/data/default-object', [$this, 'filter_jet_listings_data_default_object'], 999); |
| 196 | 198 | } |
| 197 | 199 | |
| @@ -209,8 +211,10 @@ | ||
| 209 | 211 | } |
| 210 | 212 | if (!apply_filters('e2pdf_prevent_access_to_fields_on_non_public_posts', true)) { |
| 211 | 213 | remove_filter('acf/shortcode/prevent_access_to_fields_on_non_public_posts', [$this->helper, '__return_false'], 999); |
| 212 | 214 | } |
| 215 | + remove_filter('acf/load_value', [$this, 'filter_acf_load_value'], 999); | |
| 216 | + remove_filter('do_shortcode_tag', [$this, 'filter_do_shortcode_tag_acf'], 999); | |
| 213 | 217 | } |
| 214 | 218 | remove_filter('e2pdf_pdf_render', [$this->helper, '__return_true'], 999); |
| 215 | 219 | remove_filter('e2pdf_pdf_render_filter', [$this->helper, '__return_true'], 999); |
| 216 | 220 | } |
| @@ -403,8 +407,28 @@ | ||
| 403 | 407 | if (isset($field['allow_in_bindings']) && !$field['allow_in_bindings']) { |
| 404 | 408 | $field['allow_in_bindings'] = 1; |
| 405 | 409 | } |
| 406 | 410 | return $field; |
| 411 | + } | |
| 412 | + | |
| 413 | + // filter acf load value | |
| 414 | + public function filter_acf_load_value($output) { | |
| 415 | + if (is_array($output)) { | |
| 416 | + foreach ($output as $key => $value) { | |
| 417 | + if (is_string($value)) { | |
| 418 | + $output[$key] = $this->helper->load('translator')->translate($value, 'partial'); | |
| 419 | + } | |
| 420 | + } | |
| 421 | + } | |
| 422 | + return $output; | |
| 423 | + } | |
| 424 | + | |
| 425 | + // filter do shortcode tag acf | |
| 426 | + public function filter_do_shortcode_tag_acf($output, $tag) { | |
| 427 | + if ($tag === 'acf') { | |
| 428 | + return $this->helper->load('translator')->translate($output, 'partial'); | |
| 429 | + } | |
| 430 | + return $output; | |
| 407 | 431 | } |
| 408 | 432 | |
| 409 | 433 | // filter jet engine default object |
| 410 | 434 | public function filter_jet_listings_data_default_object($default_object) { |