Sacconi69

function descbagno_select_cb

Mar 14th, 2024
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. function descbagno_select_cb( $post ) {
  2. global $wpdb;
  3. $value = get_post_meta($post->ID, 'descbagno', true);
  4.  
  5.  
  6. $descbagni = array(
  7.  
  8. __('bathrooms with shower','sacconicase') => 'bagni con doccia',
  9.  
  10. __('bathrooms','sacconicase') => 'bagni',
  11.  
  12. __('bathrooms: one with shower and the other with bath','sacconicase') => 'bagni: uno con doccia e l\'altro con vasca',
  13.  
  14.  
  15. __('bathroom + 1 toilette (wc and washbasin)','sacconicase') => 'bagno completo + 1 toilette (wc e lavandino)',
  16.  
  17. __('bathroom + 1 wc','sacconicase') => 'bagno completo + 1 wc',
  18.  
  19. __('bathroom without window','sacconicase') => 'bagno senza finestra',
  20.  
  21. __('bathroom with shower','sacconicase') => 'bagno con doccia',
  22.  
  23.  
  24. );
  25.  
  26.  
  27. echo '<select name="descbagno">';
  28. echo '<option value=""' . ((($value == '') || !isset($descbagni[$value])) ? ' selected="selected"' : '') . '> ----</option>';
  29.  
  30. // output each description of bathroom as an option
  31. foreach ($descbagni as $id => $text) {
  32. echo '<option value="' . $id . '"' . (($value == $id) ? ' selected="selected"' : '') . '">' . $text. '</option>';
  33. }
  34. echo '</select>';
  35.  
  36.  
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment