Add custom field for HTML?
-
I’ve just found this plugin and it looks awesome! I’m currently in the process of changing the images on my site for ones using the Creative Commons license.
The “Featured in” function for all my images in the Media Library Assistant means I can now do this really easily, because for each image it shows me all the posts that it’s used on! I need to change the image attribution text on all these pages so having a list per image is exactly what I need! Thanks!
The other thing which I need is a field attached to each image that I can store the attribution HTML in. Normally, when I pick a Featured Image on a Post, I then have to search my Posts library to get the attribution HTML (a link back to where I got it from, and who provided the photo). I see that I can add custom fields with this plugin. The plugin settings interface is really customisable and the documentation is really comprehensive – which is really great, but I’m getting a bit lost when trying to find out how to do this.
Here’s essentially what I want to do, can you please let me know which bits are possible, and how I do them?
1. Add some custom HTML when I upload an image, maybe into a custom field called ‘img_html’, for example:
<p class="photoSupplier">Photo: <a href="https://www.flickr.com/photos/krislitman/493626935" target="_blank">Give us this day... by Kris</a> under <a href="https://creativecommons.org/licenses/by/2.0/" target="_blank">Creative Commons license</a></p>
2a. When I’m in a Post and I click ‘Set Featured Image’ and the image grid displays, it should also show this custom field so I can copy the contents into my clipboard, select the image, then paste the HTML into the end of my Post, OR
2b. use a shortcode that will just take the contents of that custom field and insert it into the end of my Post.Thanks again for creating this plugin, it’s awesome!
- The topic ‘Add custom field for HTML?’ is closed to new replies.