Title: Fix cpta_get_file_url function
Last modified: February 11, 2020

---

# Fix cpta_get_file_url function

 *  [Art Project Group](https://wordpress.org/support/users/artprojectgroup/)
 * (@artprojectgroup)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/)
 * Hi, in your functions.php file you must fix the `cpta_get_file_url` function.
   You are sending a bad URL.
 * Please change line 14 from this:
    `return $upload_dir['baseurl'].$file_path;`
 * to this:
    `return $file_path;`
 * Kind regards.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [readconsult](https://wordpress.org/support/users/readconsult/)
 * (@readconsult)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/#post-12534118)
 * Thank you, this provides a working solution to the broken links this plugin is
   now outputting.
 * Developer please fix!
 *  [readconsult](https://wordpress.org/support/users/readconsult/)
 * (@readconsult)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/#post-12538617)
 * Unfortunately this fixes old links, but seems to break new links.
 * Old link with this solution (correct):
 * `https://www.somedomain.com/wp-content/uploads/2020/02/name_of_file.pdf`
 * Newly uploaded file link with this solution (broken):
 * `https://www.somedomain.com/2020/03/name_of_new_file.pdf`
 * You can see that the **wp-content/uploads/** is not making it into the new links.
 * Any ideas dev?
 *  Plugin Author [aviplugins.com](https://wordpress.org/support/users/avimegladon/)
 * (@avimegladon)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/#post-12543135)
 * Please update the plugin to the latest version and deactivate and reactivate 
   the plugin once after update. The issue should be fixed.
 *  [seizart](https://wordpress.org/support/users/seizart/)
 * (@seizart)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/#post-13145561)
 * please fix issue, it on t work with new update

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fix cpta_get_file_url function’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-pdf-attachment/assets/icon-256x256.png?
   rev=2067420)
 * [Custom Post Type Attachment](https://wordpress.org/plugins/custom-post-type-pdf-attachment/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-pdf-attachment/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-pdf-attachment/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-pdf-attachment/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-pdf-attachment/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-pdf-attachment/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [seizart](https://wordpress.org/support/users/seizart/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/fix-cpta_get_file_url-function/#post-13145561)
 * Status: not resolved