<?php

function copyrightData($type = 'name')
{
    $type = (isset($type)) ? $type : 'name';

    return get_post_meta(get_post_thumbnail_id(), "setrobot_copyright_{$type}", true);
}

<?php

function copyrightData($id_img, $type = 'name')
{
    $type = (isset($type)) ? $type : 'name';

    return get_post_meta($id_img, "setrobot_copyright_{$type}", true);
}

Improve method copyrightData() with parameter $id_img
Improve method copyrightData() with parameter $id_img

$id_img it’s ID the image
