How to get image ID to use inside wp_read_image_metadata()?
I would like to automatically set the alternative text to be the same as the title of a post when image is uploaded. The attachment’s image alternative text is stored in the post meta table under the _wp_attachment_image_alt meta key. In media_handle_upload() and media_handle_sideload() we have: $id = wp_insert_attachment($attachment, $file, $post_id); if ( !is_wp_error($id) ) … Read more