Me­dia Credit

This plu­g­in adds a “Cred­it” field when up­load­ing me­dia to posts and dis­plays it un­der the im­ages on your blog to prop­er­ly cred­it the artist.

When adding me­dia through the Me­dia Up­loader tool or edit­ing me­dia al­ready in the Me­dia Li­brary, this plu­g­in adds a new field to the me­dia form that al­lows users to as­sign cred­it for giv­en me­dia to a user of your blog (as­sist­ed with au­to­com­plete) or to any freeform text (e.g. cour­tesy pho­tos, etc.).

When this me­dia is then in­sert­ed in­to a post, a new short­code, [media-credit], sur­rounds the me­dia, in­side of any cap­tion, with the pro­vid­ed me­dia cred­it in­for­ma­tion. Me­dia cred­it in­side this short­code is then dis­played on your blog un­der your me­dia with the class .media-credit, which has some de­fault styling but which you can cus­tomize to your heart’s content.

3 Comments

  1. Dear Pe­ter, I think your plu­g­in is very good… But How can I open ex­ter­nal links in blank page us­ing the cred­it link?
    Is it pos­si­ble to do?

    1. Author

      @Alessio: At the mo­ment, you would have to fil­ter the short­code han­dler (sor­ry, not doc­u­ment­ed yet, please look at the Github im­ple­men­ta­tion for now) and pro­vide your own HTML output. 

      Since us­ing target="_blank" is dep­re­cat­ed for ac­ces­si­bil­i­ty rea­sons, I’ll prob­a­bly not add this as a fea­ture in the UI. How­ev­er, I might add a spe­cif­ic fil­ter to en­able target="_blank". That would al­low you to check if the link is ex­ter­nal to your site etc.

    2. Quick fix with jQuery would be to add the target=“_blank” at­tribute on all an­chors in­side the class .media-​credit with rel=“nofollow” like so:

      $(‘.media-​credit > a[rel=nofollow]’).each(function() {
      $(this).attr(‘target’, ‘_​blank’);
      });

Leave a Reply

You have to agree to the comment policy.