save_post function keeps triggering: Warning: array_map(): Argument #2 should be an array… when restoring from trash

So, I had to explicitly define the key value pairs to get it to work when untrashing. Not sure why it worked everywhere else though as just an array of ids.

added:

$thisupdate = array (
                    'fields'      => $pages,
                    'post_status' => 'publish'
);

wp_update_post( $thisupdate );