How to check if user is uploading/setting an image as a featured image?
Determining if an attachment actually is a featured image is easy: get_post_thumbnail_id( get_post() ); which is a convenience function around get_post_meta( get_post()->ID, ‘_thumbnail_id’, true ); It is a bit more complicated if you know nothing than the File name or Url. add_filter( ‘wp_handle_upload_prefilter’, function( $file ) { $url = wp_get_attachment_image_src( get_post_thumbnail_id( get_post() ), ‘post-thumbnail’ ); … Read more