I’ve noticed Myf is starting to add image credits to the ends of her pages:
Really this credit should be stored as metadata on the feature image itself, rather than as a paragraph at the end of the page content, because then:
The credit only has to be defined once, and it’ll appear whenever the image is used.
The right credit(s) will always be displayed automatically – no need to update credits when you add/remove/change the images attached to a post.
WordPress doesn’t have a built-in "credits" field in the attachment metadata. But:
We could repurpose one of the existing fields, eg: Caption. (But this will require uploaders to write HTML, which isn’t great.)
We could create our own field(s) on the attachment form. (Annoyingly, it looks like Carbon Fields can’t do this for us, so we’d have to write the fields from scratch.)
We’ll then need some logic in the page templates to store the credits for any images rendered on the page, and print them all out in a single section at the end.
I’ve noticed Myf is starting to add image credits to the ends of her pages:
Really this credit should be stored as metadata on the feature image itself, rather than as a paragraph at the end of the page content, because then:
WordPress doesn’t have a built-in "credits" field in the attachment metadata. But:
We’ll then need some logic in the page templates to store the credits for any images rendered on the page, and print them all out in a single section at the end.