Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Have a custom taxonomy "guest" with extra fields.

    foreach ($extra_fields as $field => $display) { ?>
    <tr class="form-field">
    <th scope="row" valign="top"><label for="<?php echo $field;?>"><?php echo $display;?></label></th>
    <td><input type="text" name="<?php echo $field;?>" id="<?php echo $field;?>" /></td>
    </tr>
    <?php   
    }

There are 10 extra fields per taxonomy. Can I / should I save these as an array so each "guest" has 1 entry in the guestmeta table instead of 10 entries? Retrieval of the data is also a concern.

update_metadata('guest', $term_id, 'guest_meta', array($field1 => $value1, $field2 => $value2));  

vs

foreach($extra_fields as $field => $value){
  update_metadata('guest', $term_id, $field, $value);  }
share|improve this question
    
You are presenting a choice between two valid approaches without any criteria to choose by. Simply put - either works. Which to go with depends on specific needs of the project. –  Rarst Oct 8 '12 at 20:49
add comment

closed as not a real question by Rarst Oct 8 '12 at 20:50

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.