If you are not seeing metadata for your fields in the order screen, this might be because you are using the same field label for multiple fields. E.g. if you have two fields called ‘Extras’ then the second field might overwrite the first field.
To avoid this, please use this filter:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set unique metadata item ID | |
*/ | |
function prefix_field_label_item_meta_data( $field_label, $field, $item ) { | |
$field_label .= '_' . $field['field_id']; | |
return $field_label; | |
} | |
add_filter( 'pewc_field_label_item_meta_data', 'prefix_field_label_item_meta_data', 10, 3 ); |
Here’s how to add that snippet.