plugin-icon

ACF Media Credit

作者:donaldG2·
Adds an option to create as many media credit fields as needed for an image.
评级
5
版本
2.3.7
活跃安装
100
最后更新
Apr 2, 2018

This plugin uses the Repeater field of Advanced Custom Fields to add options for a Credit and Credit Link on each item in your Media Library. Currently this will only correlate and display for IMAGES on the front end. This does not support credits for .pdf files, .swf files, .doc files, etc.

Requires either Advanced Custom Fields Pro or the free version of ACF with the Repeater Field add-on.

I suggest using ACF Pro with this plugin.

ACF Fields are exported as a json file (for ACF Pro) in the ‘acf_exports’ directory of this plugin. ACF Pro allows you to import that json file if for some reason you’re having trouble getting the fields to load.

If you’re a developer there are functions available to you (see: dongaines.com/acf-media-credit)

In the ‘/inc/’ directory the fields have been exported as PHP to work w/ ACF Pro or ACF free

Functions

There are a handful of functions available for your use and there is more explanation given to them at dongaines.com/acf-media-credit. The functions available: the_post_thumbnail_media_credit(); //does not require an attachment id the_media_credit_html($attachment_id); //returns the_media_credit($attachment_id); //echos the_media_credit_html(); the_plain_media_credit($attachment_id); //outputs the most basic markup print_r(get_media_credit($attachment_id)); //helpful for debugging

For images with a caption I’m filtering the caption shortcode, please do the same if you need to make a change: add_filter( 'img_caption_shortcode', 'your_function_name', 10, 3 );

Added filters: add_filter(‘acf_media_credit_base_output’, ‘your_function_name’); //your_function_name($image_credit) add_filter(‘acf_media_credit_div_class’, ‘your_function_name’); //your_function_name($media_credit_div_class)

免费基于付费套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 4.9.29
这个插件是可用的下载,适用于您的站点。