Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Parent child category dropdown #738
    vsatyarthi
    Member

    I’m sorry, I wasn’t clear to the question.

    Please take a look on these images.

    http://s22.postimg.org/efot1ppmp/business_hours.png

    http://s22.postimg.org/tpoo8wl4x/category_selection.png

     

    Rightnow I’m doing it with wordpress core functions, I’m curious how to achieve this with piklist.

    On business hours, check box decides what day to be save as post_meta

    Piklist saves hours of work and code is properly structured and easy to understand for me, thats why I’m looking forward if such kind of functionality can be achieved with this framework

    in reply to: Parent child category dropdown #726
    vsatyarthi
    Member

    I need two drop-down menus, first has the parent categories and second will populate child categories based on the selection of first drop down.

    Also, I’ve been trying to have a metabox to set business hours for a custom post type. For that I’m using ‘group’ as field type, according to your documentation. All I wanna do is to save the nested drop-down values only if the checkbox is selected. Below is my code, I’d be grateful if you can tell me where I’m mistaking. below is my code

     

     

     

    $timing = array(

    ’06:00 am’ => ’06:00 am’

    ,’06:30 am’ => ’06:30 am’

    ,’07:00 am’ => ’07:00 am’

    ,’07:30 am’ => ’07:30 am’

    ,’08:00 am’ => ’08:00 am’

    ,’08:30 am’ => ’08:30 am’

    ,’09:00 am’ => ’09:00 am’

    ,’09:30 am’ => ’09:30 am’

    ,’10:00 am’ => ’10:00 am’

    ,’10:30 am’ => ’10:30 am’

    ,’11:00 am’ => ’11:00 am’

    ,’11:30 am’ => ’11:30 am’

    ,’12:00 am’ => ’12:00 am’

    ,’12:30 am’ => ’12:30 am’

    ,’01:00 pm’ => ’01:00 am’

    ,’01:30 pm’ => ’01:30 am’

    ,’02:00 pm’ => ’02:00 am’

    ,’02:30 pm’ => ’02:30 am’

    ,’03:00 pm’ => ’03:00 am’

    ,’03:30 pm’ => ’03:30 am’

    ,’04:00 pm’ => ’04:00 am’

    ,’04:30 pm’ => ’04:30 am’

    ,’05:00 pm’ => ’05:00 am’

    ,’05:30 pm’ => ’05:30 am’

    ,’06:00 pm’ => ’06:00 am’

    ,’06:30 pm’ => ’06:30 am’

    ,’07:00 pm’ => ’07:00 am’

    ,’07:30 pm’ => ’07:30 am’

    ,’08:00 pm’ => ’08:00 am’

    ,’08:30 pm’ => ’08:30 am’

    ,’09:00 pm’ => ’09:00 am’

    ,’09:30 pm’ => ’09:30 am’

    ,’10:00 pm’ => ’10:00 am’

    ,’10:30 pm’ => ’10:30 am’

    ,’11:00 pm’ => ’11:00 am’

    ,’11:30 pm’ => ’11:30 am’

    ,’12:00 pm’ => ’12:00 am’

    ,’12:30 pm’ => ’12:30 am’

    ,’01:00 am’ => ’01:00 am’

    ,’01:30 am’ => ’01:30 am’

    ,’02:00 am’ => ’02:00 am’

    ,’02:30 am’ => ’02:30 am’

    ,’03:00 am’ => ’03:00 am’

    ,’03:30 am’ => ’03:30 am’

    ,’04:00 am’ => ’04:00 am’

    ,’04:30 am’ => ’04:30 am’

    ,’05:00 am’ => ’05:00 am’

    ,’05:30 am’ => ’05:30 am’

    );

    piklist(‘field’, array(

    ‘type’ => ‘checkbox’

    ,’field’ => ‘business_day’

    ,’label’ => ‘Business Day’

    ,’attributes’ => array(

    ‘class’ => ‘text’

    ,’id’ => ”

    )

    ,’value’ => array(‘monday’,’tuesday’,’wednesday’,’thursday’,’friday’,’saturday’,’sunday’)

    ,’choices’ => array(

    ‘monday’ => ‘monday [field=monday]’

    ,’tuesday’ => ‘tuesday [field=tuesday]’

    ,’wednesday’ => ‘wednesday [field=wednesday]’

    ,’thursday’ => ‘thursday [field=thursday]’

    ,’friday’ => ‘friday [field=friday]’

    ,’saturday’ => ‘saturday [field=saturday]’

    ,’sunday’ => ‘sunday [field=sunday]’

    )

    ,’fields’ => array(

    array(

    ‘type’ => ‘group’

    ,’field’ => ‘monday’

    ,’label’ => ‘monday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘tuesday’

    ,’label’ => ‘tuesday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘wednesday’

    ,’label’ => ‘wednesday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘thursday’

    ,’label’ => ‘thursday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘friday’

    ,’label’ => ‘friday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘saturday’

    ,’label’ => ‘saturday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    ,array(

    ‘type’ => ‘group’

    ,’field’ => ‘sunday’

    ,’label’ => ‘sunday’

    ,’columns’ => 12

    ,’fields’ => array(

    array(

    ‘type’ => ‘select’

    ,’field’ => ‘open_time’

    ,’label’ => ‘open time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    ,array(

    ‘type’ => ‘select’

    ,’field’ => ‘close_time’

    ,’label’ => ‘close time’

    ,’columns’ => 4

    ,’choices’ => $timing

    )

    )

    )

    )

    ));

     

Viewing 2 posts - 1 through 2 (of 2 total)