Media Credit

Feel free to get in touch with us about anything you’d like me to add to this plugin or any feedback. We love hearing from our users! Start a thread on the plugin forum and we’ll get back to you shortly!

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.

You can also display all the media by an author on the author’s page. See more in the FAQ.
Options

This plugin provides a few options which appear on the Media page under Settings. These options are:

  • Separator
  • Organization
  • Display credits after post

Example

This is best explained with an example. With a separator of ” | ” and an organization of The Daily Times, media inserted will be followed with a credit line appearing as follows, with the username linking to the author page for that user:

John Smith | The Daily Times

Further explanation

Separator: These are the characters that separate the display name for a user on your blog from the name of the organization, as described below. The default separator is ” | ” but feel free to change this to suit your needs.

Organization: This is what appears after the separator as listed above. The default organization is the name of your blog.

Display credits after post: With this option enabled, media credit shortcodes will not appear by default when inserting media into your posts. Instead, the plugin will look through the content of your posts for any media attachments and display something like the following at the end of each post with the CSS class .media-credit-end:

Images courtesy of John Smith | The Daily Times, Michael Scott and Jane Doe.

In this example, John Smith is a user of your blog, while the latter two credits are not.

Download — Join already using this plugin

Latest version: Download Media Credit v4.3.0 [zip]

View on the WordPress plugin directory here: Media Credit

Changelog

4.3.0 (April 1, 2023)

  • Feature: Media Credit is now fully compatible with PHP 8.2.
  • Bugfix: Author queries now use capabilities instead of the deprecated 'who' => 'authors'.
  • Bugfix: run_wptexturize filter now can be used even after the plugin is initialized.
  • Change: WordPress minimum version increased to 5.9.0.
  • Change: PHP minimum version increased to 7.4.0.

4.2.1 (July 30, 2021)

  • Bugfix: Don’t eat content between multiple shortcodes on save and switch between visual and HTML mode in the classic editor.

4.2.0 (July 22, 2021)

  • Feature: A shorter label for credits displayed at the end of a post can be enabled via the new filter hook media_credit_at_end_use_short_label (Images: instead of Images courtesy of).
  • Feature: The automatic linking of user credits to the WordPress author page can be disabled with the new filter hook media_credit_disable_author_urls.
  • Feature: Media Credit is now fully compatible with PHP 8.0.
  • Bugfix: The credit overlay cannot be selected any more by accident in the classic editor.
  • Bugfix: Several visual glitches in classic editor have been fixed and parsing has been made more robust.
  • Bugfix: Credit width is set properly for custom image sizes when editing image properties in the classic editor.
  • Bugfix: Organization and separator are set correctly when adding a user credit via the image properties dialogue in the classic editor.
  • Bugfix: Autocomplete works reliably again in Media Library.
  • Bugfix: Credits can be deliberately set to be empty again when credits to WordPress authors are enabled (had been broken since 4.0.0).
  • Bugfix: No more Notice: register_rest_route was called incorrectly during plugin initialization.
  • Change: WordPress minimum version increased to 5.2.0.
  • Change: PHP minimum version increased to 7.0.0.
  • Change: Support for Internet Explorer 11 has been dropped.
  • Change: A fabulous new plugin icon designed by Johanna Amann.

28 thoughts on “Media Credit

  1. Luke

    Hi Scott,

    Can this plugin handle the situation where multiple images are contained in a post and a different credit is required for each one? How would I display the credit for each image rather than one credit at the bottom of the post? I would like to access credits per image programatically,

    thanks!

    Reply
    1. Scott Bressler Post author

      Hi Luke,

      Media Credit absolutely can handle multiple images per post. See here for an example.

      What do you mean you would like to access the image credits programmatically? Do you mean that you want to display the credits yourself instead of letting the plugin display them for you? You can certainly do that as well! Take a look at the third FAQ for the plugin; you’re going to want to use .

      Let me know if you have any further questions or difficulty using the plugin!

      -Scott

      Reply
  2. Luke

    Hi Scott – thanks for your reply. The difficulty we’re having seems to be that the credit is not saving to the database but reverting to the author name. Do you have any idea what might be causing that?

    Reply
  3. Romeo B.

    I am having the same problem as Luke. Even when I fill in a new name for the credit field, it always reverts back to Admin, as that’s the username I’m signed in under. It seems that it’s not saving what’s written int the credit field. I’m using WP3.0.

    Reply
  4. CArl

    Hello,

    It seems that there is now a problem with the media credit plug. When attempting to edit a post that I have used the plug tag with, the entire post is not showing up in the edit window when using VISUAL view, however; the post will show up under HTML view with codes.

    After disabling the plug, the posts reappear in VISUAL view.

    Suggestions?

    Reply
  5. Francesco

    I think one thing is missing for this excellent plugin: the ability to add a custom field with a link for the custom credit. In other words, I would like to be able to add to pictures a custom credit name and a custom link, not only a custom credit name.

    Regards, Francesco.

    Reply
    1. Scott Bressler Post author

      Thanks for this excellent bit of feedback! Coincidentally, I actually got the same request from someone else this week and added the answer to the FAQ for the plugin above.

      Here’s the relevant section:

      Can I link to an artist inside a media credit field?

      You sure can. Just link to the artist’s website in the name attribute in the media-credit shortcode, found in HTML view for a post, or directly when adding an image. For example, if your post contains:

      [media-credit name="Artist" align="alignleft" width="300"]<img src="http://www.mysite.com/files/2010/09/image.jpg" width="300" height="450" class="size-300 wp-image-2" />[/media-credit]

      change it to:

      [media-credit name="<a href='http://www.artistwebsite.com/'>Artist</a>" align="alignleft" width="300"]<img src="http://www.mysite.com/files/2010/09/image.jpg" width="300" height="450" class="size-300 wp-image-2" />[/media-credit]

      Note the link to www.artistwebsite.com above.

      I’m considering making this easier so people who don’t know HTML can do this as well, and I will let you know if I begin working on another approach. However, for now, this should hopefully suffice. Always open to feedback!

      Reply
  6. Brian Robertson

    Ok Scott, I love the concept of this plugin! What do you think about in the settings being able to set a custom “Media Credit Phrase” – just leave it blank if you don’t want to use it – and also a “Link Target”. And then with each image have the following options: “Photographer” and “Photographer’s Site” – or something like that. Then, beneath the image it adds (my php probably isn’t correct, but you’ll get the point):

    <?php echo (Media Credit Phrase) & " " & (Photographer) & "/>"; ?>

    Example: “Photo provided by Bald Brian

    Reply
  7. eddie

    Hi Scott,

    Love the concept of your plugin. I can’t get it to work though. Like some of the above posters, the name I enter reverts to the post author’s name upon saving. I’m running 1.1.1.

    Thanks,
    Eddie

    Reply
    1. Scott Bressler Post author

      Hi Eddie,

      I’m sorry to hear about your troubles with the plugin. What version of WP are you using? Does the issue happen every time you try to give credit to users? Does it only happen for users of your blog, or only for “freeform” credits, or does it happen for any and all credit you try to attribute?

      -Scott

      Reply
  8. Harry Underwood

    First off, I wanted to say that this plugin is extremely useful to my current job, as I did not have a proper means of attaching names to images as well as posts before this and Post Author Box. I am glad for both plugins’ existences.

    That said, I also wanted to ask if it is possible to further integrate Media Credit into the TinyMCE image capabilities in WordPress. When one wants to edit an image in a post (say, for size and external linking), Media Credit is conspicuously missing from among the options of editing the attributes of images (but not from when one wants to upload an image or go into the gallery of already uploaded images). Also, I wonder if NextGEN Gallery’s makers could benefit from your contribution.

    Once again, I love this plugin, and wish I had come across it sooner! Thank you!

    Reply
  9. Gregg

    I have the same issue mentioned above running Media Credit v1.1.2 and WP v3.1.2. I insert the template tag for plain text into single.php. However, the credit below the image reverts to the post author and not the plain text I have in the credit field in my media library.

    Interestingly, the author field in the media library listing reflects the value of the credit field correctly so I suspect that the value of $post refers to the post as opposed to the attachment. I don’t know enough PHP to figure it out, but I would love to get this working correctly.

    Any thoughts?

    Reply
  10. Andy M

    Trying to attach the credit to individual photos. Done so in the upload photo section however it is not showing up under the image in an article, but is at the bottom of the article. We use many articles and would rather have the credit immediately below the image – how can i do this?

    Reply
  11. Tery

    This plugin does exactly what I need, as far as adding the credit to the image and making it easy to style. However, I’m having a problem with the styling of my pre-existing caption. As far as I can tell, media-credit puts the caption in a definition list. I need to style that definition list to remove the top margin, but I can’t find where to do that. You can see an example of the problem at http://www.whetstone.wesley.edu/2011/10/24/wesley-football-team-crushes-frostburg-state-at-homecoming/ .

    I need to change:
    <dl id="attachment_2469" class="wp-caption alignright" style="width: 310px;">
    to
    <dl id="attachment_2469" class="wp-caption alignright" style="width: 310px; margin-top:0px;">
    but I can’t find where to do that. Help?

    Reply
    1. Scott Bressler Post author

      Hi Tery,

      You’ll want to do this in your theme’s CSS file rather than modifying the plugin directly. You should be able to target the images, captions, and media credit sections using the CSS classes you see above, among other tags. Just so you know, the code you posted is part of the caption, not the Media Credit, and the styling for it is coming from line 174 in custom.css in your newsport theme. Media Credit uses divs and spans only.

      Also, in your custom.css file, you specify a bunch of MC-specific styles. However, the targeting is incorrect for many of theme: .wp-caption-dt should be .wp-caption dt and so on.

      When modifying the caption styles, you might want to consider only modifying them if they immediately follow an MC div using adjacent sibling selectors, such as .media-credit-container + .wp-caption.

      Reply
      1. Tery

        Thanks, Scott. The reason I thought the definition list code was coming from media-credit is that I have two images on that page — one with media-credit and one without. The one with media credit looks like this:
        <div class="mceTemp"><div class="media-credit-container alignright" style="width: 310px"><a href="http://www.whetstone.wesley.edu/2011/10/24/wesley-football-team-crushes-frostburg-state-at-homecoming/rb-brandon-wright-breaks-the-tackle-of-34-joeseph-ross-2/&quot; rel="attachment wp-att-2469"><img class="size-medium wp-image-2469" title="Rb Brandon Wright breaks the tackle of 34 Joeseph Ross." src="http://www.whetstone.wesley.edu/wp-content/uploads/2011/10/IMG_45331-300×200.jpg&quot; alt="" width="300" height="200" /></a><span class="media-credit">The Whetstone/ Cochise Lucas</span></div><dl id="attachment_2469" class="wp-caption alignright" style="width: 310px;"><dt class="wp-caption-dt"></dt><dd class="wp-caption-dd">Rb Brandon Wright breaks the tackle of 34 Joeseph Ross.</dd></dl></div>

        while the one without media-credit looks like this:
        <div id="attachment_2463" class="wp-caption alignleft" style="width: 210px"><a href="http://www.whetstone.wesley.edu/2011/10/24/wesley-football-team-crushes-frostburg-state-at-homecoming/img_4756-2/&quot; rel="attachment wp-att-2463"><img class="size-medium wp-image-2463" title="IMG_4756" src="http://www.whetstone.wesley.edu/wp-content/uploads/2011/10/IMG_47561-200×300.jpg&quot; alt="" width="200" height="300" /></a><p class="wp-caption-text">The Whetstone/ Cochise Lucas</p></div>

        I’ll try changing the values for the alignright class, but I’m afraid that will affect too many other places on the site. If that doesn’t work, is the solution then to find the caption processing in WordPress and add a third class, after alignright, to override that top margin?

      2. Tery

        I tried changing the top margin in alignright to 0px. That’s not fixing the problem. Also, the reason I specified .wp-caption-dt is that that’s the class associated with the dt. I thought the class would override the standard dt declaration, though I could be wrong about that. My CSS abilities are okay but not stellar.

      3. Scott Bressler Post author

        There are issues with using the “Visual” editor in WordPress 3.2 and up, so that’s likely why you have the “mceTemp” div. Try using the HTML editor.

        I’d recommend you put the navy background on something that surrounds both the media credit and the caption to ensure that there are no gray bars in between. If you can’t find anything to target with your CSS, you can surround the images yourself by filtering the_content in your functions.php file, though beware of any performance degradation.

  12. Tery

    Hi — Is this still supported? If so, I’m having a weird problem. When the media-credit plugin is active, I can’t insert images into posts. When I disable it, I can insert images again. I can’t disable it permanently because it seems to mess up the look of older posts, where we used the media-credit field, when it’s not active. So what we’re having to do is disable media-credit, insert the images into the post, then enable media-credit again. We’re running WordPress 3.5.1 with the Advanced Newspaper Theme from Gabfire.

    Reply
  13. Art Campbell

    Really delighted to see the version 2 roll out!
    I’d been kludging the 1.x by hand for probably a year or more…
    However, the 2.0 version isn’t working on my site at all. Can’t insert media into a post if anything is in the Credit field….

    Anything I can check?

    Reply
  14. Mar

    Your plugin works flawlessly. However, I am running into a situation where I’d like the thumbnails that your plugin places on my page via the template tag to be picked up by thickbox or slimbox as a gallery viewer. Is there a configuration or a php file that I can alter that will allow a thickbox plugin to pick up the thumbnails and display in a gallery rather than displaying each image on its own page?

    Reply
  15. Jon

    Thanks for creating this plugin- it works great! Only one minor issue I was wondering about. After I have added an image, the edit and remove buttons on the image in the visual editor lose all their styling and are difficult to see on darker images. Below is the difference in code before and after Media Credit is activated:

    Without Media Credit activated:

    With Media Credit activated:


    The js changes the divs to ‘p’ and ‘i’ and then the styling disappears. I know this is a minor issue, but was wondering if it could be changed so the default styling doesn’t go away. I’ve tried to override the styling, but for some reason am having trouble getting it to apply to ‘#wp-image-toolbar i’.

    Best,
    Jon

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *