Change the post thumbnail URL

Change the URL of an attachment (thumbnail) based on the conditions you define.
// NAV: Change the url for thumbnail for post
function wpcoder_change_post_thumbnail_url($url, $post_id) {
    if (strpos($url, 'img/uploads/') !== false) {
        $year = date('Y'); // Year folder
        $month = date('m'); // Month folder
        $url =  str_replace("img/uploads/", "app/uploads/", $url);
    }

    return $url;
}

add_filter('wp_get_attachment_url', 'wpcoder_change_post_thumbnail_url', 10, 2);