Media changes not updating posts

Yes, that is Core behavior. The Post Editor saves whatever alt text, caption, and title you use while editing a specific Post/Page/CPT into its post content, in HTML if you are using the Classic Editor, or in Image block attributes if you are using the Block Editor. One workaround is to always upload media directly … Read more

Getting a specific value out of array using get_attached_media

Don’t use the GUID. Despite appearances, that isn’t an URL. Use wp_get_attachment_image_src. Something like: $image = wp_get_attachment_image_src($post_id,’full’); echo $image[0]; Or use wp_get_attachment_url with the post ID. $image = wp_get_attachment_url($post_id); Of course, I don’t know what the actual variable name is that holds your images but you should see the ID in the post objects and … Read more

Remove delete-attachment button for every media

Rather than focusing on the button itself, focus on what you want users to do. If you don’t want your users to be able to delete media, and you are also comfortable with them not being able to delete other post types (Posts, Pages, etc.), you can create a custom role for these users. <?php … Read more

Set Maximum Width for an uploaded image

Full size images are unmodified by default as it literally is the full size image. You could ensure the photo is a suitable size prior to uploading or restructure your theme so that full size images are not linked and are perhaps replaced by large images which can have their size set in WP Admin.