Amazon_S3_And_CloudFront::get_attachment_folder_time PHP Method

get_attachment_folder_time() public method

Use post datetime if attached.
public get_attachment_folder_time ( integer $post_id ) : integer | string
$post_id integer
return integer | string
    function get_attachment_folder_time($post_id)
    {
        $time = current_time('timestamp');
        if (!($attach = get_post($post_id))) {
            return $time;
        }
        if (!$attach->post_parent) {
            return $time;
        }
        if (!($post = get_post($attach->post_parent))) {
            return $time;
        }
        if (substr($post->post_date_gmt, 0, 4) > 0) {
            return strtotime($post->post_date_gmt . ' +0000');
        }
        return $time;
    }
Amazon_S3_And_CloudFront