ھي پلگ ان WordPress جي جديد 3 وڏين رليزز سان آزمايو نه ويو آھي. اهو ٿي سگهي ٿو وڌيڪ برقرار يا سپورٽ نه ٿي سگهي ۽ ٿي سگهي ٿو مطابقت جا مسئلا جڏهن ورڈپریس جي وڌيڪ تازي ورزن سان استعمال ڪيو وڃي.

Image Credits

وضاحت

Adds source name and URL fields for media uploads along with a shortcode for displaying image credits for all images within an entry, including its featured image.

WordPress natively doesn’t provide the ability to manage where you’ve pulled different media from, so this can be helpful in making sure you provide links back to the contents’ creators.

تصوير

  • Example usage.

انسٽاليشن

  1. Upload image-credits to the /wp-content/plugins/ directory.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Use the shortcode [image-credits] or function get_image_credits(); to display credits for all the images used within an entry, including the featured image.

FAQ

How do I display the image credits?

Use the shortcode [image-credits] or function get_image_credits();.

[image-credits] can accept before, after, and sep (seperator) parameters. By default, the before is “Image Credits: ” and the separator is “, ” (a comma plus a space). Example modified usage:

[image-credits before="Image Credits... " sep=" - "]

get_image_credits(); accepts one parameter, $seperator, which is again by default “, ” and returns the results (doesn’t echo). You will either need to return or echo the function depending on your code.

I’m not good at coding and don’t want to manually put the shortcode in every single one of my posts. Can you give me some example code to work with?

Sure. Throw this into your theme’s functions.php file and the image credits will appear at the bottom of every post:

/**
 * Add image credits to the end of posts
 * 
 */
add_filter( 'the_content', 'ac_image_credits' );

function ac_image_credits( $content ) {

    if ( is_singular( 'post' ) ) {

        $content .= '<p>[image-credits]</p>';

    }

    return $content;

}
Which image credits does it display?

Both the shortcode and function will get the credits for all images contained within the post content, including the featured image.

It searches through the post content for attachment IDs rather than get the IDs of the images attached to the post because sometimes you may upload an image then not actually use it, or you may reuse an image that is attached to an old post. This makes the credits more accurate.

جائزا

جمع: سڀ 6 تبصرا پڙهو

تعاون ڪندڙ & ڊولپرز

“Image Credits” اوپن سورس سافٽ ويئر آهي. ھيٺين ماڻھن ھن پلگ ان ۾ حصو ورتو آھي.

تعاون ڪندڙ

ترجمو ڪريو “Image Credits” توهان جي ٻولي ۾.

ڊولپمينٽ ۾ دلچسپي؟

ڪوڊ براؤز ڪريو، چيڪ ڪريو SVN مخزن، يا رڪنيت حاصل ڪريو ڊولپمينٽ لاگ پاران RSS.

لاگ تبدیل ڪريو

Version 1.1

  • Fixed error caused by not defining variables as arrays before using them in in_array functions
  • Removed whitespace in code
  • Added help text to media input fields
  • Cleaned up FAQ and added another usage example

Version 1.0

  • This is version 1.0. Everything’s new!