跳至主要內容
  • 登入
  • 註冊
WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress

外掛目錄

  • 我的最愛
  • Beta 版測試
  • 開發者資訊

這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

下載

Media Credit

由 Peter Putzer 開發
  • 詳細資料
  • 使用者評論
  • 開發資訊
技術支援

外掛說明

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.

螢幕擷圖

  • Media can easily be credited to the creator of the media with the new Credit field visible when uploading or editing media
  • Media credit is nicely displayed underneath photos appearing on your blog
  • Recent media items attributed to an author can be displayed nicely on the author's page using a very simple template tag (see the FAQ for more information)

常見問題集

I disabled the plugin and now unparsed [media-credit] shortcodes are appearing all over my site. Help!

Add this to your theme’s functions.php file to get rid of those pesky
[media-credit] shortcodes:

<?php
function ignore_media_credit_shortcode( $atts, $content = null ) {
    return $content;
}
global $shortcode_tags;
if ( ! array_key_exists( 'media-credit', $shortcode_tags ) )
    add_shortcode( 'media-credit', 'ignore_media_credit_shortcode' );
?>

Also, I’d really appreciate it if you gave us some feedback as to why you disabled the plugin and how it could have better suited your needs.

Can I display all or recent media credited to a given author?

Indeed, just call the template tag <?php \Media_Credit::display_author_media( $author_id ); ?> in your theme’s author.php (or elsewhere, if you want). The template tag has optional parameters if you want to customize the CSS or text. The default options will display thumbnails of the 10 most recent media items credited to the given user floated to the right with a width of 150px and a header of <h3>Recent Media</h3>.

These options can be changed with a more verbose call to the function: <?php \Media_Credit::display_author_media( $author_id, $sidebar = true, $limit = 10, $link_without_parent = false, $header = "<h3>Recent Media</h3>", $exclude_unattached = true ); ?>. This will make only the 10 most recent media items that are attached to a post display with the given header taking up the maximum width it’s afforded. Each image will link to the post in which it appears, or the attachment page if it has no parent post (unless $link_without_parent is set to false). If you don’t care about whether the media is attached to a post, change $exclude_unattached to false. This function as a whole will only display media uploaded and credited to a user after this plugin was installed.

More generally, can I insert media credit information into my themes with a template tag, for instance on category pages?

I’m so glad you asked; you certainly can! Just call <?php \Media_Credit::get_html( $attachment ); ?> with an attachment id (int) or WP_Post object for an attachment to get the media credit, including a link to the author page. To echo the results, call <?php \Media_Credit::html( $attachment ); ?>.

Is there a template tag that just gives plain text rather than a link to the author page for users of my blog?

Yep! If you would prefer plain-text rather than a link for all media credit (and leaving out the separator and organization), call <?php \Media_Credit::get_plaintext( $attachment ); ?> which uses the same parameter as above. To echo the results, call <?php \Media_Credit::plaintext( $attachment ); ?>.

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

You sure can. Just add the link 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="left" width="300"]<img src="https://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="Artist" link="https://www.artistwebsite.com/" align="left" width="300"]<img src="https://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.

Why do I get unparsed [media-credit] shortcodes in my Facebook/Twitter/… previews with JetPack Publicize?

Unfortunately, this is a known bug in JetPack that can only be fixed by Automattic. As a workaround, use a different plugin for posting to social networks. Alternatively, if you make sure that you haven’t got any images with credits within the first 55 words of your article, you should be fine, too.

Your question was not answered in the FAQ?

Feel free to get in touch with us about anything you’d like us to add to this list by leaving a message in the WordPress.org support forums here.

使用者評論

Thanks to this plugin

Romain Herault 2021 年 10 月 20 日 1 則留言
Does exactly what is asked of it, resources for developers, what more could you ask for?

Must have, great!

freezeweb 2020 年 4 月 18 日 1 則留言
Great plugin, does exactly what I need on my blogs. Happy to see that the developer is still working on it too. I love that you can select wp users in the credit box, this opened up a great workflow for me where I have multiple photographers contributing to my blog.

Simple & elegant

jorgeletralia 2019 年 6 月 6 日 1 則留言
Our website uses images from the most diverse sources. This plugin helps us show in an elegant way the credits of those images. It is very simple to configure and the free support is simply excellent.

GREAT plugin!

BruceRawles 2019 年 5 月 20 日 1 則留言
An excellent plugin that works well and provides a very professional-looking media credit below images. Kudos also to the plugin author for assisting me (and my client who edits YachatsNews.com) by quickly providing a mechanism for swapping the order of the media credit and caption (see the support forum for details.) THANKS! 🙂

works perfectly

danichtfuer 2018 年 7 月 18 日 1 則留言
Superb Plug-In. Nice backend integration. Comes with handy functions for customization.

Just what we needed

mcasbtech 2017 年 2 月 6 日
Adds much-needed proper image credits to our museum site. Developer has been super responsive to bug reports/feature requests. Thanks!
閱讀全部 19 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Media Credit〉的開發相關工作。

參與者
  • pepe
  • Scott Bressler

〈Media Credit〉外掛目前已有 5 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Media Credit〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

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.

4.1.1 (December 10, 2020)

  • Bugfix: Credits containing apostrophes can be edited in the legacy Media Library view.
  • Bugfix: Changes to nofollow flag are now saved in the legacy Media Library view as well.
  • Bugfix: The plugin is now compatible with WordPress 5.6.

4.1.0 (April 17, 2020)

  • Feature: Images cropped in the Customizer inherit the credit from the original image.
  • Feature: Credits are read from EXIF/IPTC fields on image upload.
  • Bugfix: No markup is added to core/image blocks when no credit is set.
  • Bugfix: Attachment details input fields are set to read-only when the user lacks write permissions for the image.
  • Bugfix: Malformed shortcodes won’t break the editor anymore.
  • Bugfix: Some error messages were not getting translated because of a WP.org infrastructure change.
  • Change: All external PHP dependencies have been moved to the namespace Media_Credit\Vendor to reduce the chance of conflicts with other plugins.

4.0.4 (May 19, 2019)

  • Bugfix: Prevent PHP warning for incomplete core/image blocks.

4.0.3 (Mar. 20, 2019)

  • Bugfix: Print credit for featured images, not for the parent post.
  • Bugfix: Slightly improved compatibility with responsive themes (by using max-width instead of width).

4.0.2 (Mar. 18, 2019)

  • Bugfix: Don’t whitescreen when the shortcode handler is called with an empty string instead of argument array.
  • Bugfix: Featured images can be set normally again when Do not credit images to WordPress users is enabled.

4.0.1 (Mar. 11, 2019)

  • Bugfix: Uploads via the Edit Post or New Post screens should work again.

4.0.0 (Mar. 11, 2019)

  • Feature: Full REST API support (reading and writing).
  • Feature: A custom default credit for new attachments can be set via the GUI or the new filter hook media_credit_new_attachment_default.
  • Feature: Placeholder texts can be customized via the new filter hook media_credit_placeholder_text.
  • Feature: Images added via the Block Editor (Gutenberg) will be displayed with their credit.
  • Feature: New autoload-friendly template tag API based on the Media_Credit class. The old function-based API has been deprecated.
  • Change: The previously deprecated template function get_freeform_media_credit has been removed.
  • Change: In HTML5 mode, the credit has been moved inside the <figcaption>.
  • Change: PHP minimum version increased to 5.6.0.
  • Bugfix: When default credits are disabled, the display name of a user can be used as a freeform credit again.

中繼資料

  • 最新版本: 4.2.1
  • 最後更新: 2 年前
  • 啟用安裝數: 1,000+
  • WordPress 版本需求: 5.2 或更新版本
  • 已測試相容的 WordPress 版本: 5.8.6
  • PHP 版本需求: 7.0 或更新版本
  • 語言:

    English (US)、French (France)、German、German (Austria)、German (Switzerland)、及 Spanish (Spain).

    將這個外掛本地化為你的母語版本

  • 標籤:
    bylinecreditimageimagesmedia
  • 進階檢視

評分

檢視全部
  • 5 星 16
  • 4 星 0
  • 3 星 0
  • 2 星 1
  • 1 星 2
登入以提交評論

參與者

  • pepe
  • Scott Bressler

技術支援

最近 2 個月解決的問題:

總計 1 個問題,已解決 0 個

查看技術支援論壇

  • 關於我們
  • 最新消息
  • 主機託管
  • 贊助基金會
  • Swag
  • 線上說明
  • 開發者資源
  • 共同參與
  • Learn
  • 展示網站
  • 外掛目錄
  • 佈景主題目錄
  • 區塊版面配置目錄
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • 隱私權
  • Public Code
WordPress.org
WordPress.org

Taiwan 正體中文

  • 造訪我們的 Facebook 粉絲專頁
  • 造訪我們的 Twitter 帳號
  • Visit our Instagram account
  • Visit our LinkedIn account
程式碼,如詩