Title: [Plugin: Auto Post Thumbnail] Relative paths?
Last modified: August 20, 2016

---

# [Plugin: Auto Post Thumbnail] Relative paths?

 *  [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-auto-post-thumbnail-relative-paths/)
 * Hello,
 * this is a great idea and a nice plugin.
 * 1. could you please add some code into the plugin, that it would work well even
   with the relative paths? Say that I have the image as /images/2011/05/apple.png.
   Then curl_get_file_contents() or file_get_contents() fails to fetch it in apt_generate_post_thumb().
   Just adding site domain name in front of $imageUrl would fix the issue.
 * Without this, it barely works for us, as we convert sites from other blog system
   a lot and they often use relative paths.
 * 2. Also, it would be nice, if it worked even on save_post, not only on publish_post.
 * Thanks,
    Martin
 * [http://wordpress.org/extend/plugins/auto-post-thumbnail/](http://wordpress.org/extend/plugins/auto-post-thumbnail/)

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

 *  Thread Starter [FolioVision](https://wordpress.org/support/users/foliovision/)
 * (@foliovision)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-auto-post-thumbnail-relative-paths/#post-2078394)
 * 2. For this, you will have to check if the post is revision:
 *  `if( wp_is_post_revision($post_id) ) {
    return true; } `
 * Thanks,
    Martin
 *  [adityamooley](https://wordpress.org/support/users/adityamooley/)
 * (@adityamooley)
 * [15 years ago](https://wordpress.org/support/topic/plugin-auto-post-thumbnail-relative-paths/#post-2078763)
 * Thanks for the suggestions. Point #1 is really something I would look to add 
   in the plugin.
 * About point #2, I am not sure whether its a good idea since we will also have
   to show the featured image once its created. And it will require some more changes.
   And finally, the basic idea behind the plugin was to create the featured image
   only when the post is published so that the user gets the opportunity to set 
   own featured image.
 * Aditya
 *  [garfy](https://wordpress.org/support/users/garfy/)
 * (@garfy)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-auto-post-thumbnail-relative-paths/#post-2078809)
 * i have build wp in local host, 200 articles, now all thumbs are still ponting
   to local host, why you did not use relative paths???
 * you know many people work in xampp dont you?

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

The topic ‘[Plugin: Auto Post Thumbnail] Relative paths?’ is closed to new replies.

 * ![](https://ps.w.org/auto-post-thumbnail/assets/icon-256x256.gif?rev=3469511)
 * [Auto Featured Image (Auto Post Thumbnail)](https://wordpress.org/plugins/auto-post-thumbnail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-post-thumbnail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-post-thumbnail/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-post-thumbnail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-post-thumbnail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-post-thumbnail/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [garfy](https://wordpress.org/support/users/garfy/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-auto-post-thumbnail-relative-paths/#post-2078809)
 * Status: not resolved