Tagged: ,

Viewing 3 reply threads
  • Author
    Posts
    • #4252
      achowell
      Member

      Seems like one of my text-area boxes is duplicating in one of my meta-boxes, and it’s not consistent in the amount in each individual post (of the post type). I attached an example.

      I checked the code and the only field name with the ‘project_description’ value is that one, all I really have for this field is this:

      
      piklist('field', array(
       'type' => 'textarea'
       ,'scope' => 'post_meta' // Not used for settings sections
       ,'field' => 'project_description'
       ,'label' => 'Project Description'
       ,'description' => 'This is a description of the project.'
       ,'attributes' => array(
         'class' => 'text'
       )
       ));

      I’m having difficulty figuring out what may have caused this.

      Attachments:
      You must be logged in to view attached files.
    • #4255
      Steve
      Keymaster

      @achowell– This code snippet looks fine. It would help if we can see all your code. Either post here, or email to [email protected]

      • #4260
        achowell
        Member

        Thanks Steve, it’s in my meta-boxes folder and this is the entirety of the code for this meta box, I have one other meta box and it does not have this problem (as far as I have seen).

        <?php
        /*
        Title: Project Information
        Post Type: mro_project
        Order: 2
        priority: high 
        */
        ?>
        <?php
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_address'
            ,'label' => 'Address'
            ,'description' => 'Project Address'
            //,'value' => 'Default text'
            ,'help' => 'Enter the address of the project.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_city'
            ,'label' => 'City'
            ,'description' => 'City of the project'
            //,'value' => 'Default text'
            ,'help' => 'Enter the city location of the project.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_state'
            ,'label' => 'State'
            ,'description' => 'State of the project'
            //,'value' => 'Default text'
            ,'help' => 'Enter the state location of the project.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_zip'
            ,'label' => 'Zip'
            ,'description' => 'Zip Code of the project'
            //,'value' => 'Default text'
            ,'help' => 'Enter the zip code of the project.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
         'type' => 'textarea'
         ,'scope' => 'post_meta' // Not used for settings sections
         ,'field' => 'project_description'
         ,'label' => 'Project Description'
         ,'description' => 'This is a description of the project.'
         ,'attributes' => array(
           'class' => 'text'
         )
         ));
        
        piklist('field', array(
         'type' => 'textarea'
         ,'scope' => 'post_meta' // Not used for settings sections
         ,'field' => 'project_comments'
         ,'label' => 'Project Comments'
         ,'description' => 'Enter any extra comments or notes here.'
         ,'attributes' => array(
           'class' => 'text'
         )
         ));
        
        piklist('field', array(
         'type' => 'textarea'
         ,'scope' => 'post_meta' // Not used for settings sections
         ,'field' => 'project_transport'
         ,'label' => 'Project Transportation'
         ,'description' => 'Enter transportation information on the project.'
         ,'attributes' => array(
           'class' => 'text'
         )
         ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_limit'
            ,'label' => 'Volunteer Limit'
            ,'description' => 'Enter the max # of volunteers'
            //,'value' => 'Default text'
            ,'help' => 'If there is no limit enter 0.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'leader_limit'
            ,'label' => 'Team Leader Limit'
            ,'description' => 'Enter the max # of team leaders'
            ,'value' => '1'
            ,'help' => 'If there is no limit enter 0.'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
         'type' => 'datepicker'
         ,'scope' => 'post_meta' // Not used for settings sections
         ,'field' => 'project_date'
         ,'label' => 'Date'
         ,'description' => 'Click in box to set the date of the project'
         ,'attributes' => array(
           'class' => 'text'
         )
        ,'options' => array(
           'dateFormat' => 'M d, yy'
           ,'firstDay' => '0'
        )
        ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_starttime'
            ,'label' => 'Start Time'
            ,'description' => 'Set the time the project starts'
            ,'help' => 'Enter the time the project starts'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        piklist('field', array(
            'type' => 'text'
            ,'field' => 'project_endtime'
            ,'label' => 'End Time'
            ,'description' => 'Set the time the project ends'
            ,'help' => 'Enter the time the project ends'
            ,'attributes' => array(
              'class' => 'text'
            )
          ));
        
        /*
        piklist('field', array(
            'type' => 'group'
            ,'label' => 'Start/End Time'
            ,'description' => 'Set the times the project begins and ends.'
            ,'fields' => array(
              ,array(
                'type' => 'text'
                ,'field' => 'project_start'
                ,'label' => ''
                //,'columns' => 3
                ,'value' => '12:00 AM'
              )
              ,array(
                'type' => 'text'
                ,'field' => 'project_end'
                ,'label' => ''
                //,'columns' => 3
                ,'value' => '12:00 PM'
              )
            )
          ));
          */
        ?>
    • #4264
      Steve
      Keymaster

      I tested this code and it works great for me. Are there any other Piklist meta boxes on the page? If so, make sure none of them have a field called project_description

      • #4265
        achowell
        Member

        There aren’t any duplicates of that field name from what I see, I know that my WordPress version is a bit behind if that would effect anything.

    • #4266
      Steve
      Keymaster

      Does this happen on EVERY new post?

      Try this and see if it helps:

      piklist('field', array(
      	'type' => 'textarea'
      	,'scope' => 'post_meta' // Not used for settings sections
      	,'field' => 'project_description'
      	,'label' => 'Project Description'
      	,'description' => 'This is a description of the project.'
      	,'attributes' => array(
      		'rows' => 10
      		,'cols' => 50
      		,'class' => 'large-text'
      	)
       ));
      
      • #4268
        achowell
        Member

        Yes, it still seems to do this with the code you gave me, it happens in every new post, always shows 5 extra text-area boxes.

      • #4271
        Steve
        Keymaster

        Try removing the scope parameter on all fields. Piklist can figure it out.

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