change placeholders for selects in order page

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13810
    Olly
    Admin & Mod

      by default, if you are using a select type for one of your fields in the order form, the initial select/placeholder will be displayed as ‘———‘
      if you want to change that to something more descriptive, you could use the following filter in your theme’s functions.php

      
      add_filter('wppizza_filter_formfields_order', 'myprefix_add_placeholder_to_select');
      function myprefix_add_placeholder_to_select($elements){
      foreach($elements as $k=>$elm){
      if($elm['type']=='select'){	
      $elements[$k]['placeholder']='some placeholder';
      }
      }
      return $elements;
      }
      

      you can adapt this for non selects too of course, just use

      
      if($elm['key']=='/*selected key you want to set placeholder for*/'){
      /*etc*/
      }
      
    Viewing 1 post (of 1 total)
    • The topic ‘change placeholders for selects in order page’ is closed to new replies.