Viewing 0 reply threads
  • Author
    Posts
    • #7028
      rharrigan
      Participant

      This is not related to the problem here: https://piklist.com/support/topic/hidden-field-bugs/

      The group add_more does not display correctly when a hidden field is included in a group.

      Here is my erroneous code –

      
      Title: Recipe Options
      Post Type: recipe
      Order: 1
      Collapse: false
      */
      
      piklist('field', array(	
        'type' => 'group'
        ,'add_more' => true
        ,'scope' => 'post_meta'
        ,'columns' => 12
        ,'fields' => array(
          array(
            'field' => 'recipe_id'
            ,'type' => 'hidden'
            ,'value' => ''
          )
          ,array(
            'field' => 'recipe_title'
            ,'columns' => 12
            ,'label' => __('Recipe Title','ideas_solutions')
            ,'type' => 'text'
            ,'required' => true
            ,'columns' => 12
          )	
        )
      ));
      

      This is working code –

      
      Title: Recipe Options
      Post Type: recipe
      Order: 1
      Collapse: false
      */
      
      piklist('field', array(	
        'type' => 'group'
        ,'add_more' => true
        ,'scope' => 'post_meta'
        ,'columns' => 12
        ,'fields' => array(array(
            'field' => 'recipe_title'
            ,'columns' => 12
            ,'label' => __('Recipe Title','ideas_solutions')
            ,'type' => 'text'
            ,'required' => true
            ,'columns' => 12
          )	
        )
      ));
      

      It would be nice to have hidden fields in an add_more so I can filter the meta data on insert/update

Viewing 0 reply threads
  • You must be logged in to reply to this topic.