Sacconi69

nopostoauto php error

Oct 8th, 2024
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. $lang = substr( get_locale(), 0, 2 );
  2. $terms = get_the_terms( get_the_ID(), 'postoauto');
  3. $trans = __( 'No parking place', 'sacconicase' ).'.';
  4.  
  5. if ( is_array( $terms )) {
  6. $term = $terms[0]; // get the zeroth element in array, a WP_Term object
  7. if ( $lang == 'it' ){$term_name8 = $term->name ;
  8. $term_name8_str = empty( $term_name8 ) ? '' : "$term_name8. ";
  9.  
  10. } else {$term_name8 = get_term_meta( $term->term_id , 'postoauto_'.$lang, true ) ;
  11. $term_name8_str = empty( $term_name8 ) ? '' : "$term_name8. ";
  12. }
  13. } else {
  14. $term_name8 = '';
  15. $term_name8_str = "$trans " ;
  16.  
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment