Viewing 2 reply threads
  • Author
    Posts
    • #8398

      Hey,

      Having an odd problem with a meta box on a custom page template. For some reason the data will add once but will not update at all.

      
      <?php
      /*
      Title: Homepage Notice
      Post Type: page
      Template: page-home
      Order: 5
      */
      
      piklist('field', array(
          'type' => 'radio',
          'field' => 'notice_option',
          'label' => 'Would you like to add a notice?',
          'choices' => array(
              'no' => 'No',
              'yes' => 'Yes'
          ),
      
          
      ));
      
      piklist('field', array(
          'type' => 'group'
          //,'field' => 'notice_group'
          ,'label' => __('Notice Group', 'piklist-demo')
          ,'list' => false
          ,'fields' => array(
            array(
              'type' => 'text'
              ,'field' => 'notice_title'
              ,'label' => __('Title', 'piklist-demo')
              ,'columns' => 12
              ,'attributes' => array(
                'placeholder' => 'Notice Title'
              )
            )
      
            ,array(
          'type' => 'radio',
          'field' => 'notice_colour',
          'label' => 'Notice Colour',
          
          
          'choices' => array(
              'warning' => 'Yellow',
              'success' => 'Green',
              'info' => 'Blue',
              'danger' => 'Red'
          ),
          
          
      
          )
      
            ,array(
          'type' => 'textarea',
          'field' => 'notice_text',
          'label' => 'Contents',
          'attributes' => array(
            'class' => 'regular-text',
            'rows' => 2,
            'placeholder' => 'Notice text goes here' 
          ),
          'columns' => 12,
          
          )
      
            
            
          
          ) //end of fields
          ,'on_post_status' => array(
            'value' => 'lock'
          )
          ,'conditions' => array(
              array(
                  'field' => 'notice_option',
                  'value' => 'yes'
              )
          )
        ));
      
      piklist('field', array(
          'type' => 'text',
          'field' => 'notice_test',
          'label' => 'Notice Test',
          /*'conditions' => array(
              array(
                  'field' => 'notice_choices',
                  'value' => 'yes'
              )
          ),*/
          'columns' => 10
          
      ));

      It’s happening with and without the conditional. I’ve added a basic test field that is just text. Happens here too.

      Scratching my head.

    • #8399

      So after some testing it’s pretty much all fields added by piklist except those in repeater fields?!

      What on earth could have caused this and failed so silently?

    • #8400

      Sorry ….. i’d added the remove_post_type_support for post but not pages! Sorry. Working fine now.

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