You need to call get_post_thumbnail_id()
with the ID
of the post, not the post object.
$importbookcoverid = get_post_thumbnail_id( $importbookpost->ID );
and you should be fine.
You need to call get_post_thumbnail_id()
with the ID
of the post, not the post object.
$importbookcoverid = get_post_thumbnail_id( $importbookpost->ID );
and you should be fine.