Osama_Mersal

Translate numbers in ATE

Feb 9th, 2023
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. /**
  2.  * Allow translating numbers
  3.  *
  4.  * @see https://wpml.org/forums/topic/wpbakery-post-grid-element-exclude-from-filter-list-category-reappears
  5.  */
  6. function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) {
  7.     $data = $job_translate['field_data'];
  8.  
  9.     if ( 'base64' === $job_translate['field_format'] ) {
  10.         $data = base64_decode( $data );
  11.     }
  12.  
  13.     if ( is_numeric( $data ) ) {
  14.         return true;
  15.     }
  16.  
  17.     return $is_translatable;
  18. }
  19. add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );
Add Comment
Please, Sign In to add comment