add multiple values (array) to post meta_input
Question
i have a custom post type where a post is generated by a form submit. One key is an array which should be stored in a custom field… i shortended the code below to the important part -> they key is “event_musikstil”
'meta_input' => array(
// Custom Fields
'event_musikstil' => foreach( $event_musikstil as $item ) { add_post_meta( $post_id, "_event_musikstil", $item ); },
)
0
custom-field, post-meta, wp-insert-post
3 years
2019-10-28T18:36:45-05:00
2019-10-28T18:36:45-05:00 0 Answers
99 views
0
Leave an answer