- This topic has 1 reply, 1 voice, and was last updated 2 years, 1 month ago by .
I am doing a custom import of CPT by using the PHP API.
One CTP has a group field, I wonder how to save the serialized value in the meta data.
I have tried it like this:
$meta_value = serialize([ [ 'active' => 1, 'release_date' => $driverData['date'], 'version' =>; $driverData['version'], 'download_count' => $driverData['counter'], 'file' => [$driverFileAttachmentId], 'os_compat' => $osCompat //is array ] ]); add_post_meta($found_post->ID, 'treiber_group', $meta_value);
The meta box is added like this: https://ghostbin.com/paste/eg26u
When I try to open the CPT I see:
Warning: Invalid argument supplied for foreach() in /home/user/public_html/modules/meta-box-aio/extensions/meta-box-group/class-rwmb-group-field.php on line 228
Warning: Invalid argument supplied for foreach() in /home/user/public_html/modules/meta-box/inc/clone.php on line 28
- You must be logged in to reply to this topic.