Tagged: , ,

Viewing 1 reply thread
  • Author
    Posts
    • #7648

      Hi, i just want to make my own api with piklist fields, is there any way to make this?

      i just have a piklist field

      //horarios
      $days = array();

      $days[0] = “Choose an option”;
      $days[1] = “Monday”;
      $days[2] = “Tuesday”;
      $days[3] = “Wednesday”;
      $days[4] = “Thursday”;
      $days[5] = “Friday”;
      $days[6] = “Saturday”;
      $days[7] = “Sunday”;

      piklist(‘field’, array(
      ‘type’ => ‘group’
      ,’columns’ => 12
      ,’label’ => __(‘Horarios de la parroquia’)
      ,’field’ => ‘parroquia_horarios’
      ,’add_more’ => true
      ,’fields’ => array(
      array(
      ‘type’ => ‘select’
      ,’field’ => ‘day’
      ,’columns’ => 6
      ,’attributes’ => array(
      ‘class’ => ‘text’
      ),
      ‘choices’ => $days,
      ‘required’ => true
      )
      ,array(
      ‘type’ => ‘text’
      ,’field’ => ‘time’
      ,’columns’ => 6
      ,’attributes’ => array(
      ‘placeholder’ => ’09:00′
      )
      )
      )

      ));

      i want to request my endpoint and receive by answer something like this

      {
      “Monday” : [
      “00:09″,”12:00″,”15:00”, …and so on
      ],
      “Thursday” : [

      ]
      }

    • #7660
      Steve
      Keymaster

      @cegodai– Piklist fields will save as normal meta that you can access with the REST API.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.