This plugin adds a “Credit” field when uploading media to posts and displays it under the images on your blog to properly credit the artist.
When adding media through the Media Uploader tool or editing media already in the Media Library, this plugin adds a new field to the media form that allows users to assign credit for given media to a user of your blog (assisted with autocomplete) or to any freeform text (e.g. courtesy photos, etc.).
When this media is then inserted into a post, a new shortcode, [media-credit]
, surrounds the media, inside of any caption, with the provided media credit information. Media credit inside this shortcode is then displayed on your blog under your media with the class .media-credit
, which has some default styling but which you can customize to your heart’s content.
Dear Peter, I think your plugin is very good… But How can I open external links in blank page using the credit link?
Is it possible to do?
@Alessio: At the moment, you would have to filter the shortcode handler (sorry, not documented yet, please look at the Github implementation for now) and provide your own HTML output.
Since using
target="_blank"
is deprecated for accessibility reasons, I’ll probably not add this as a feature in the UI. However, I might add a specific filter to enabletarget="_blank"
. That would allow you to check if the link is external to your site etc.Quick fix with jQuery would be to add the target=“_blank” attribute on all anchors inside the class .media-credit with rel=“nofollow” like so:
$(‘.media-credit > a[rel=nofollow]’).each(function() {
$(this).attr(‘target’, ‘_blank’);
});