How to post an unserialized array via wordpress rest API as meta data
So I found my own answer, fave_property_images is not supposed to be an array, its just multiple strings. Therefore the following codes in function.php fixes the problem. function add_fave_property_images() { register_rest_field(‘property’, ‘fave_property_images’, array( ‘get_callback’ => ‘get_property_images’, ‘update_callback’ => ‘update_property_images’, ) ); } function get_property_images( $object ) { //return the post meta return get_post_meta( $object[‘id’], ‘fave_property_images’, … Read more