• Resolved itsViney

    (@itsviney)


    On a website I’m building, we have a page that lists all the attachments on our site and use custom fields to store the original author name and the source URL of the image so we can display attribution. Is it possible to have these custom fields be populated automatically when Instant Images downloads an image from Unsplash?

Viewing 1 replies (of 1 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @itsviney Instant Images has an action that’s fired after an image has been uploaded. instant_images_after_upload()

    function my_instant_images_callback( $args ) {
    	print_r( $args ); 
    }
    add_action( 'instant_images_after_upload', 'my_instant_images_callback');

    https://github.com/dcooney/instant-images/blob/main/api/download.php#L164-L172

    You could use this hook to add your own custom field data or what ever you need to do.

    It contains some info about the image that has been uploaded. This action hasn’t been touched in years and I can see it needs to be updated to contain additional information.

Viewing 1 replies (of 1 total)
  • The topic ‘Automatically add author and source URL to attachment meta?’ is closed to new replies.