I used this great one liner code to display with comma separated ID numbers of all attached images to a post. But I couldnt extract the featured image ID from it. How can I extract the featured image ID by using and adding this nice code?
$ids = join( ',', wp_list_pluck( get_attached_media('image' ), 'ID' ) );
got from How do I create Comma Separated list of attached image ids?